Skip to content

Commit d58339e

Browse files
committed
Update documentation
1 parent 8d604ef commit d58339e

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

docs/api.md

+20-7
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@ This class is specific to the Portenta H7 board.
2323
| [`allowDeepSleep`](#class_low_power_portenta_h7_1a7ed518f8205a0b7306d23b7e2a22e82b) | Make Deep Sleep possible in the default case. |
2424
| [`canDeepSleep`](#class_low_power_portenta_h7_1a07d9e0f356e40ac70655e279fbad87a9) | Check if Deep Sleep is possible or not at the moment. |
2525
| [`checkOptionBytes`](#class_low_power_portenta_h7_1a7519d3acf693f450af84312576d8e669) | Check if the option bytes are correct to enter Standby Mode. |
26-
| [`previousCPUMode`](#class_low_power_portenta_h7_1a07557aeee28ba41e80b8b847e965ee11) | Returns the previous CPU mode and resets the flag. |
26+
| [`wasInCPUMode`](#class_low_power_portenta_h7_1ae2059eb4fb01a30342b9fb6918b6ab4c) | Checks if the microcontroller was in the given standby mode before waking up. Note: It's possible that the microcontroller was in more than one of these modes during standby. Call this function multiple times to check for each mode. Important: When you're done checking, call resetStandbyModeFlags() to reset the flags so they are reported correctly the next time the microcontroller wakes up. |
27+
| [`resetPreviousCPUModeFlags`](#class_low_power_portenta_h7_1a1753e3c053b2b64b59da3cbb9b921d76) | Reset the flags that are used to determine the microcontroller's previous standby mode. This is necessary to get correct results from [wasInCPUMode()](#class_low_power_portenta_h7_1ae2059eb4fb01a30342b9fb6918b6ab4c). |
2728
| [`numberOfDeepSleepLocks`](#class_low_power_portenta_h7_1a9d2730d86abf42782261b0f03778c3bb) | Check how many Deep Sleep locks are held at the moment. |
2829
| [`prepareOptionBytes`](#class_low_power_portenta_h7_1abdc0ce13b68d3a2188702690997af2ae) | Prepare the option bytes for entry into Standby Mode. |
2930
| [`standbyM4`](#class_low_power_portenta_h7_1a9e07fd4f7895a7753e7e28f99aca1ace) | Make the M4 core enter Standby Mode. |
3031
| [`standbyM7`](#class_low_power_portenta_h7_1a1eb5cec6e9604a48074f1c10ef5e7fb0) | Make the M7 core enter Standby Mode. |
31-
| [`timeSinceBoot`](#class_low_power_portenta_h7_1a4758c25574b6d099545ac8d55eff6f68) | Time since the board was booted. |
32+
| [`timeSinceBoot`](#class_low_power_portenta_h7_1a4758c25574b6d099545ac8d55eff6f68) | Time since the board was booted. It reports the time since the last wake-up reset (after standby) or power-on depending on what happened last. |
3233
| [`timeSpentIdle`](#class_low_power_portenta_h7_1ad42fdfa6885d8e0fdca5aa012fdb4c60) | Time spent in idle. |
3334
| [`timeSpentInSleep`](#class_low_power_portenta_h7_1a994eb6fcc0382515a82b81fa37ca9f3c) | Time spent in Sleep Mode. |
3435
| [`timeSpentInDeepSleep`](#class_low_power_portenta_h7_1a146eb61800a74360687fd34b456c0b44) | Time spent in Deep Sleep Mode. |
@@ -69,16 +70,28 @@ Check if the option bytes are correct to enter Standby Mode.
6970
A constant from the LowPowerReturnCode enum.
7071
<hr />
7172

72-
### `previousCPUMode` <a id="class_low_power_portenta_h7_1a07557aeee28ba41e80b8b847e965ee11" class="anchor"></a>
73+
### `wasInCPUMode` <a id="class_low_power_portenta_h7_1ae2059eb4fb01a30342b9fb6918b6ab4c" class="anchor"></a>
7374

7475
```cpp
75-
CPUMode previousCPUMode() const
76+
bool wasInCPUMode( CPUMode mode) const
7677
```
7778
78-
Returns the previous CPU mode and resets the flag.
79+
Checks if the microcontroller was in the given standby mode before waking up. Note: It's possible that the microcontroller was in more than one of these modes during standby. Call this function multiple times to check for each mode. Important: When you're done checking, call resetStandbyModeFlags() to reset the flags so they are reported correctly the next time the microcontroller wakes up.
80+
#### Parameters
81+
* `mode` The CPU mode to check.
7982
8083
#### Returns
81-
The previous CPU mode.
84+
True if the microcontroller was in the given mode, false otherwise.
85+
<hr />
86+
87+
### `resetPreviousCPUModeFlags` <a id="class_low_power_portenta_h7_1a1753e3c053b2b64b59da3cbb9b921d76" class="anchor"></a>
88+
89+
```cpp
90+
void resetPreviousCPUModeFlags() const
91+
```
92+
93+
Reset the flags that are used to determine the microcontroller's previous standby mode. This is necessary to get correct results from [wasInCPUMode()](#class_low_power_portenta_h7_1ae2059eb4fb01a30342b9fb6918b6ab4c).
94+
8295
<hr />
8396

8497
### `numberOfDeepSleepLocks` <a id="class_low_power_portenta_h7_1a9d2730d86abf42782261b0f03778c3bb" class="anchor"></a>
@@ -140,7 +153,7 @@ A constant from the LowPowerReturnCode enum.
140153
uint64_t timeSinceBoot() const
141154
```
142155

143-
Time since the board was booted.
156+
Time since the board was booted. It reports the time since the last wake-up reset (after standby) or power-on depending on what happened last.
144157

145158
#### Returns
146159
Number of microseconds.

0 commit comments

Comments
 (0)