add sleep() as wrapper for __wfe()

This commit is contained in:
hathach committed 2017-04-06 15:45:51 +07:00
1 parent 3822bf91af
commit f50708b24c
2 files changed
+9 -2

No files matched your search

+5
View File
@@ -24,6 +24,11 @@ extern "C" {
extern void init(void);
static inline void sleep(void)
{
__WFE();
}
extern void enterSerialDfu(void);
extern void enterOTADfu(void);
@@ -87,7 +87,7 @@ void loop()
}
// forward from Serial to BLEUART
if (Serial.available())
while (Serial.available())
{
// delay to get enough inputs, since we have limited number of transmission buffer
delay(2);
@@ -98,12 +98,14 @@ void loop()
}
// forward from BLEUART to Serial
if ( bleuart.available() )
while ( bleuart.available() )
{
uint8_t ch;
ch = (uint8_t) bleuart.read();
Serial.write(ch);
}
sleep();
}
void connect_callback(void)