Access to the ESP8266 system.
More...
Access to the ESP8266 system.
System class.
- Note
- Provides system control and monitoring of the ESP8266.
bool SystemClass::deepSleep |
( |
uint32 |
timeMilliseconds, |
|
|
DeepSleepOptions |
options = eDSO_RF_CAL_BY_INIT_DATA |
|
) |
| |
Enter deep sleep mode.
- Parameters
-
timeMilliseconds | Quantity of milliseconds to remain in deep sleep mode |
options | Deep sleep options |
Get the CPU frequency.
- Return values
-
CpuFrequency | The frequency of the CPU |
static unsigned SystemClass::getMaxTaskCount |
( |
| ) |
|
|
inlinestatic |
Get maximum number of tasks seen on queue at any one time.
- Return values
-
- Note
- If return value is higher than maximum task queue TASK_QUEUE_LENGTH then the queue has overflowed at some point and tasks have been left un-executed.
static unsigned SystemClass::getTaskCount |
( |
| ) |
|
|
inlinestatic |
Get number of tasks currently on queue.
- Return values
-
static bool SystemClass::initialize |
( |
| ) |
|
|
static |
System initialisation.
- Return values
-
- Note
- Called by user_main: applications should not call this function or the task queue will be re-initialised and any currently queued tasks won't be called.
bool SystemClass::isReady |
( |
| ) |
|
|
inline |
Check if system ready.
- Return values
-
bool | True if system initialisation is complete and system is now ready |
Set handler for system ready event.
- Parameters
-
readyHandler | Function to handle event |
- Note
- if system is ready, callback is executed immediately without deferral
Set handler for system ready event.
- Parameters
-
readyHandler | Function to handle event |
- Note
- if system is ready, callback is executed immediately without deferral
static bool IRAM_ATTR SystemClass::queueCallback |
( |
TaskCallback |
callback, |
|
|
uint32_t |
param = 0 |
|
) |
| |
|
static |
Queue a deferred callback.
- Parameters
-
callback | The function to be called |
param | Parameter passed to the callback |
- Return values
-
bool | false if callback could not be queued |
- Note
- It is important to check the return value to avoid memory leaks and other issues, for example if memory is allocated and relies on the callback to free it again. Note also that this method is typically called from interrupt context so must avoid things like heap allocation, etc.
void SystemClass::restart |
( |
unsigned |
deferMillis = 0 | ) |
|
Request a restart of the system.
- Parameters
-
deferMillis | defer restart request by a number of milliseconds |
- Note
- A delay is often required to allow network callback code to complete correctly. The restart is always deferred, either using the task queue (if deferMillis == 0) or using a timer. This method always returns immediately.
Set the CPU frequency.
- Parameters
-