File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,13 @@ ISR(PORTD_PORT_vect) {
91
91
}
92
92
}
93
93
94
+ ISR (PORTF_PORT_vect) {
95
+ if (PORTF.INTFLAGS & PIN6_bm) {
96
+ asm (" jmp 0" );
97
+ PORTF.INTFLAGS = PIN6_bm;
98
+ }
99
+ }
100
+
94
101
void connectedToNetwork (void ) { event_flags |= NETWORK_CONN_FLAG; }
95
102
void disconnectedFromNetwork (void ) { event_flags |= NETWORK_DISCONN_FLAG; }
96
103
void connectedToBroker (void ) { event_flags |= BROKER_CONN_FLAG; }
@@ -261,6 +268,8 @@ void handleSerialCommand(const char *instruction, uint16_t instructionLen) {
261
268
}
262
269
} else if (strcmp (cmd, " heartbeat" ) == 0 ) {
263
270
event_flags |= SEND_HEARTBEAT_FLAG;
271
+ } else if (strcmp (cmd, " reset" ) == 0 ) {
272
+ asm (" jmp 0" );
264
273
} else {
265
274
Log.info (" \n Invalid command" );
266
275
printHelp ();
@@ -277,6 +286,11 @@ void setup() {
277
286
// Set PD2 as input (button)
278
287
pinConfigure (PIN_PD2, PIN_DIR_INPUT | PIN_INT_FALL);
279
288
289
+ // Set PF6 as input (reset button)
290
+ pinConfigure (PIN_PF6, PIN_DIR_INPUT | PIN_INT_FALL);
291
+
292
+ sei ();
293
+
280
294
Log.infof (" Starting sandbox / landing page procedure. Version = %s\r\n " ,
281
295
SANDBOX_VERSION);
282
296
You can’t perform that action at this time.
0 commit comments