1212 * Documentation: http://www.mysensors.org
1313 * Support Forum: http://forum.mysensors.org
1414 *
15+ * STM32 architecture support added by Alexander KooLru <[email protected] > 16+ * Copyright (C) 2022 Alexander KooLru
17+ * STM32 sleep mode and EEPROM support added by WhiskyDelta <[email protected] > 18+ * Copyright (C) 2022 Arne Schwarz
19+ *
1520 * This program is free software; you can redistribute it and/or
1621 * modify it under the terms of the GNU General Public License
1722 * version 2 as published by the Free Software Foundation.
@@ -125,7 +130,7 @@ int8_t hwSleep(uint32_t ms)
125130 // Return what woke the mcu.
126131 // Default: no interrupt triggered, timer wake up
127132 int8_t ret = MY_WAKE_UP_BY_TIMER;
128-
133+
129134 if (ms > 0u ) {
130135 // sleep for defined time
131136 LowPower.deepSleep (ms);
@@ -153,7 +158,7 @@ int8_t hwSleep(const uint8_t interrupt1, const uint8_t mode1, const uint8_t inte
153158{
154159 // According to STM32LowPower API following modes to wake from sleep are supported: HIGH, LOW, RISING, FALLING or CHANGE
155160 // Ref: https://github.com/stm32duino/STM32LowPower
156-
161+
157162 // attach interrupts
158163 _wakeUp1Interrupt = interrupt1;
159164 _wakeUp2Interrupt = interrupt2;
@@ -164,7 +169,7 @@ int8_t hwSleep(const uint8_t interrupt1, const uint8_t mode1, const uint8_t inte
164169 if (interrupt2 != INVALID_INTERRUPT_NUM) {
165170 LowPower.attachInterruptWakeup (interrupt2, wakeUp2, mode2, DEEP_SLEEP_MODE);
166171 }
167-
172+
168173 if (ms > 0u ) {
169174 // sleep for defined time
170175 return hwSleep (ms);
0 commit comments