mirror of
https://github.com/supleed2/EIE4-FYP.git
synced 2024-12-22 22:25:50 +00:00
Visualise IRQ via LED
This commit is contained in:
parent
5871150c5c
commit
e3b080235a
|
@ -40,7 +40,9 @@ can_frame can_read(void) {
|
||||||
void can_isr(void) {
|
void can_isr(void) {
|
||||||
static uint32_t count = 0;
|
static uint32_t count = 0;
|
||||||
can_ev_pending_frame_write(1); // Should use `can_ev_pending_read()` and check which interrupt, but there is only 1
|
can_ev_pending_frame_write(1); // Should use `can_ev_pending_read()` and check which interrupt, but there is only 1
|
||||||
leds_out_write(leds_out_read() ^ 0xFF0000); // Toggle Red LED
|
uint32_t o_leds = leds_out_read() >> 8; // Read LED state
|
||||||
|
uint32_t n_leds = o_leds ? o_leds : 0xFF0000; // Next LED state
|
||||||
|
leds_out_write(n_leds); // Toggle Red LED
|
||||||
count++;
|
count++;
|
||||||
can_frame frame = can_read();
|
can_frame frame = can_read();
|
||||||
printf("\033[F\033[F\33[2K\nCAN frame % 5d received, ID: 0x%03X, data: 0x%02X 0x%02X 0x%02X 0x%02X 0x%02X 0x%02X 0x%02X 0x%02X\n",
|
printf("\033[F\033[F\33[2K\nCAN frame % 5d received, ID: 0x%03X, data: 0x%02X 0x%02X 0x%02X 0x%02X 0x%02X 0x%02X 0x%02X 0x%02X\n",
|
||||||
|
|
Loading…
Reference in a new issue