summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2020-08-20 11:08:00 -0500
committerJeff Epler <jepler@gmail.com>2020-09-21 16:44:26 -0500
commita2e1867f69ec2d703a9651e5c36a02b0e14dfd9c (patch)
treed114916bc977fce546d3b6a5aaca3f925971bf86 /main.c
parente7a213a11420ed362dfb672cd0fa6e77c032fa07 (diff)
_canio: Minimal implementation for SAM E5x MCUs
Tested & working: * Send standard packets * Receive standard packets (1 FIFO, no filter) Interoperation between SAM E54 Xplained running this tree and MicroPython running on STM32F405 Feather with an external transceiver was also tested. Many other aspects of a full implementation are not yet present, such as error detection and recovery.
Diffstat (limited to 'main.c')
-rwxr-xr-xmain.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/main.c b/main.c
index 5b719dc4b..f259fea3f 100755
--- a/main.c
+++ b/main.c
@@ -81,6 +81,10 @@
#include "supervisor/shared/bluetooth.h"
#endif
+#if CIRCUITPY_CANIO
+#include "common-hal/_canio/CAN.h"
+#endif
+
void do_str(const char *src, mp_parse_input_kind_t input_kind) {
mp_lexer_t *lex = mp_lexer_new_from_str_len(MP_QSTR__lt_stdin_gt_, src, strlen(src), 0);
if (lex == NULL) {
@@ -226,6 +230,10 @@ void cleanup_after_vm(supervisor_allocation* heap) {
free_memory(heap);
supervisor_move_memory();
+ #ifdef CIRCUITPY_CANIO
+ common_hal_canio_reset();
+ #endif
+
reset_port();
#if CIRCUITPY_BOARD
reset_board_busses();