forked from MarlinFirmware/Marlin
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EMERGENCY_PARSER
support (MarlinFirmware#3)
* provide hooks for usart rx and tx * implement and enable emergency parser feature
- Loading branch information
Showing
5 changed files
with
69 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "HAL.h" | ||
|
||
// | ||
// Emergency Parser | ||
// | ||
|
||
#if ENABLED(EMERGENCY_PARSER) | ||
void usart_rx_irq_hook(uint8_t ch, uint8_t usart) | ||
{ | ||
// only handle receive on USART channel 2 (PRINT/HOST serial) | ||
if (usart != 2) | ||
return; | ||
|
||
// submit character to emergency parser | ||
if (MYSERIAL1.emergency_parser_enabled()) | ||
emergency_parser.update(MYSERIAL1.emergency_state, ch); | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters