summaryrefslogtreecommitdiff
path: root/gm_platform/fw/serial.h
diff options
context:
space:
mode:
authorjaseg <git@jaseg.net>2020-01-28 14:38:19 +0100
committerjaseg <git@jaseg.net>2020-01-28 14:38:19 +0100
commite6e49ee4818cd05be08551b6d07b1fd14ed28d78 (patch)
treefcc231ceedec56d4c1207499be78fba7cbd95fac /gm_platform/fw/serial.h
parenta8ef857d2a44c52d5e3f00d73aab18e9f9ed8f46 (diff)
downloadmaster-thesis-e6e49ee4818cd05be08551b6d07b1fd14ed28d78.tar.gz
master-thesis-e6e49ee4818cd05be08551b6d07b1fd14ed28d78.tar.bz2
master-thesis-e6e49ee4818cd05be08551b6d07b1fd14ed28d78.zip
serial if seems to work
Diffstat (limited to 'gm_platform/fw/serial.h')
-rw-r--r--gm_platform/fw/serial.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/gm_platform/fw/serial.h b/gm_platform/fw/serial.h
index 61ac4eb..8cec089 100644
--- a/gm_platform/fw/serial.h
+++ b/gm_platform/fw/serial.h
@@ -26,6 +26,7 @@
#include <stdint.h>
#include <stdarg.h>
#include <errno.h>
+#include <stdbool.h>
#include "global.h"
@@ -33,9 +34,10 @@ struct dma_tx_buf {
/* The following fields are accessed only from DMA ISR */
ssize_t xfr_start; /* Start index of running DMA transfer */
ssize_t xfr_end; /* End index of running DMA transfer plus one */
- ssize_t cur_packet;
- int retransmit_rq;
- int wraparound;
+ bool wraparound;
+ ssize_t xfr_next;
+ bool ack;
+
/* The following fields are written only from non-interrupt code */
ssize_t wr_pos; /* Next index to be written */
@@ -57,7 +59,6 @@ struct __attribute__((__packed__)) ll_pkt {
enum ctrl_pkt_type {
CTRL_PKT_RESET = 1,
CTRL_PKT_ACK = 2,
- CTRL_PKT_RETRANSMIT = 3,
};
struct __attribute__((__packed__)) ctrl_pkt {
@@ -68,7 +69,6 @@ struct __attribute__((__packed__)) ctrl_pkt {
extern volatile struct dma_tx_buf usart_tx_buf;
void usart_dma_init(void);
-int usart_dma_fifo_push(volatile struct dma_tx_buf *buf, uint8_t c);
int usart_send_packet_nonblocking(struct ll_pkt *pkt, size_t pkt_len);
int usart_ack_packet(uint8_t idx);