From 0f20b5940eba4919d0142a8c4451a33993e471f2 Mon Sep 17 00:00:00 2001 From: Jonathan Halmen Date: Tue, 4 Dec 2018 11:13:45 +0100 Subject: [PATCH 1/2] fix compilation error when ASSERTION_CHECKING --- target/min.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/min.c b/target/min.c index 5da56e3..f8c1f36 100644 --- a/target/min.c +++ b/target/min.c @@ -149,7 +149,7 @@ static void on_wire_bytes(struct min_context *self, uint8_t id_control, uint8_t static void transport_fifo_pop(struct min_context *self) { #ifdef ASSERTION_CHECKING - assert(n_frames != 0); + assert(self->transport_fifo.n_frames != 0); #endif struct transport_frame *frame = &self->transport_fifo.frames[self->transport_fifo.head_idx]; min_debug_print("Popping frame id=%d seq=%d\n", frame->min_id, frame->seq); From 8325dafb056b973a524dc76157380ea7f7410297 Mon Sep 17 00:00:00 2001 From: Jonathan Halmen Date: Tue, 4 Dec 2018 11:15:20 +0100 Subject: [PATCH 2/2] fix payload mask length when sending ACK --- target/min.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/min.c b/target/min.c index f8c1f36..6da711c 100644 --- a/target/min.c +++ b/target/min.c @@ -227,7 +227,7 @@ static void send_ack(struct min_context *self) // always the same as the sequence number. min_debug_print("send ACK: seq=%d\n", self->transport_fifo.rn); if(ON_WIRE_SIZE(0) <= min_tx_space(self->port)) { - on_wire_bytes(self, ACK, self->transport_fifo.rn, &self->transport_fifo.rn, 0, 0xffffU, 1U); + on_wire_bytes(self, ACK, self->transport_fifo.rn, &self->transport_fifo.rn, 0, 0xffU, 1U); self->transport_fifo.last_sent_ack_time_ms = now; } }