diff options
author | Uros Majstorovic <majstor@majstor.org> | 2018-03-16 14:15:39 +0100 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2018-03-16 14:15:39 +0100 |
commit | b1c3ee27894d33d9fcfca4ea4d0ccfb6d4cfc83e (patch) | |
tree | 16bfe6ba0da03cf94dec735076d2de1eac9fc761 /code/fe310/eos/net.c | |
parent | 8755ad4c0b0652f16d3505ed72ed3d8310a35c6f (diff) |
fixed race conditions
Diffstat (limited to 'code/fe310/eos/net.c')
-rw-r--r-- | code/fe310/eos/net.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/code/fe310/eos/net.c b/code/fe310/eos/net.c index 3339223..58bd5fd 100644 --- a/code/fe310/eos/net.c +++ b/code/fe310/eos/net.c @@ -26,6 +26,8 @@ static uint16_t evt_handler_wrapper_en = 0; static SPIBufQ spi_bufq; static unsigned char spi_bufq_array[SPI_SIZE_BUFQ][SPI_SIZE_BUF]; +extern EOSMsgQ _eos_event_q; + static int spi_bufq_push(unsigned char *buffer) { spi_bufq.array[SPI_BUFQ_IDX_MASK(spi_bufq.idx_w++)] = buffer; return EOS_OK; @@ -162,7 +164,7 @@ static void spi_xchg_handler(void) { SPI1_REG(SPI_REG_CSMODE) = SPI_CSMODE_AUTO; SPI1_REG(SPI_REG_IE) = 0x0; if (spi_state.cmd) { - int r = eos_evtq_push(EOS_EVT_NET | spi_state.cmd, spi_state.buf, spi_state.len_rx); + int r = eos_msgq_push(&_eos_event_q, EOS_EVT_NET | spi_state.cmd, spi_state.buf, spi_state.len_rx); if (r) spi_bufq_push(spi_state.buf); } else if ((spi_state.next_cnt || (spi_state.flags & SPI_FLAG_ONEW)) && (spi_state.next_buf == NULL)) { spi_state.next_buf = spi_state.buf; |