We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4915eb7 commit f319924Copy full SHA for f319924
1 file changed
tests/avr_test.c
@@ -2,6 +2,8 @@
2
#define ESTACK_NO_MALLOC
3
#include "easy_stack.h"
4
#include <stdlib.h>
5
+#include <avr/interrupt.h>
6
+#include <avr/sleep.h>
7
8
/*
9
* Standalone assertion helper for bare-metal AVR environment.
@@ -52,5 +54,10 @@ int main(void) {
52
54
estack_free(stack, t1);
53
55
avr_assert(estack_get_meta_index(stack) == 0);
56
57
+ cli(); // Disable all interrupts
58
+ set_sleep_mode(SLEEP_MODE_PWR_DOWN); // Set deepest sleep mode (Power-Down)
59
+ sleep_enable();
60
+ sleep_cpu(); // Put CPU to sleep. simavr will exit cleanly.
61
+
62
return 0; // Success
63
}
0 commit comments