12
12
* Documentation: http://www.mysensors.org
13
13
* Support Forum: http://forum.mysensors.org
14
14
*
15
+ * STM32 architecture support added by Alexander KooLru <kool@kool.ru>
16
+ * Copyright (C) 2022 Alexander KooLru
17
+ * STM32 sleep mode and EEPROM support added by WhiskyDelta <arne.schwarz@d2a.de>
18
+ * Copyright (C) 2022 Arne Schwarz
19
+ *
15
20
* This program is free software; you can redistribute it and/or
16
21
* modify it under the terms of the GNU General Public License
17
22
* version 2 as published by the Free Software Foundation.
@@ -125,7 +130,7 @@ int8_t hwSleep(uint32_t ms)
125
130
// Return what woke the mcu.
126
131
// Default: no interrupt triggered, timer wake up
127
132
int8_t ret = MY_WAKE_UP_BY_TIMER;
128
-
133
+
129
134
if (ms > 0u ) {
130
135
// sleep for defined time
131
136
LowPower.deepSleep (ms);
@@ -153,7 +158,7 @@ int8_t hwSleep(const uint8_t interrupt1, const uint8_t mode1, const uint8_t inte
153
158
{
154
159
// According to STM32LowPower API following modes to wake from sleep are supported: HIGH, LOW, RISING, FALLING or CHANGE
155
160
// Ref: https://github.com/stm32duino/STM32LowPower
156
-
161
+
157
162
// attach interrupts
158
163
_wakeUp1Interrupt = interrupt1;
159
164
_wakeUp2Interrupt = interrupt2;
@@ -164,7 +169,7 @@ int8_t hwSleep(const uint8_t interrupt1, const uint8_t mode1, const uint8_t inte
164
169
if (interrupt2 != INVALID_INTERRUPT_NUM) {
165
170
LowPower.attachInterruptWakeup (interrupt2, wakeUp2, mode2, DEEP_SLEEP_MODE);
166
171
}
167
-
172
+
168
173
if (ms > 0u ) {
169
174
// sleep for defined time
170
175
return hwSleep (ms);
0 commit comments