Skip to content

Commit bcfadf8

Browse files
committed
can2040: Minor comment updates
Signed-off-by: Kevin O'Connor <[email protected]>
1 parent 323ad00 commit bcfadf8

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

docs/Code_Overview.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ A secondary task of the PIO "tx" state machine is to inject an ack bit
9090
to acknowledge messages received from other CAN bus nodes. To perform
9191
this task, the ARM core fills the tx fifo with a single dominant bit
9292
and arranges for the "tx" state machine to start after a "matched"
93-
irq.
93+
irq. After the ack bit is transmitted the PIO "tx" state machine will
94+
raise an "ackdone" signal (PIO irq 3).
9495

9596
# ARM core state tracking
9697

pio/can2040.pio

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ tx_align:
126126
.program sm_tx_ack
127127
// CPU first disables state machine execution
128128
// CPU clears irq 2 and irq 3
129-
// CPU changes instruction at tx_loop from "out x, 1" to:
129+
// CPU changes instruction at tx_got_recessive from "out x, 1" to:
130130
irq wait 3
131131
// CPU then loads tx fifo with ack (single off bit)
132132
set pins, 1

src/can2040.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -942,19 +942,19 @@ report_note_discarding(struct can2040 *cd)
942942
pio_irq_set(cd, SI_MAYTX | SI_TXPENDING);
943943
}
944944

945-
// Received PIO rx "ackdone" irq
945+
// Received PIO "ackdone" irq ("tx" state machine completed ack bit transmit)
946946
static void
947947
report_line_ackdone(struct can2040 *cd)
948948
{
949-
// Setup "matched" irq for fast rx callbacks
949+
// Setup rx eof "matched" signal for fast rx callbacks
950950
uint32_t bits = (cd->parse_crc_bits << 8) | 0x7f;
951951
pio_match_check(cd, pio_match_calc_key(bits, cd->parse_crc_pos + 8));
952952
// Schedule next transmit (so it is ready for next frame line arbitration)
953953
uint32_t check_txpending = tx_schedule_transmit(cd);
954954
pio_irq_set(cd, SI_MAYTX | SI_MATCHED | check_txpending);
955955
}
956956

957-
// Received PIO "matched" irq
957+
// Received PIO "matched" irq ("match" state machine detected eof match_key)
958958
static void
959959
report_line_matched(struct can2040 *cd)
960960
{

0 commit comments

Comments
 (0)