|
|
@ -42,11 +42,8 @@ void start_slave_cmd(uint8_t slave_addr, uint16_t frame_len, uint8_t cksum) |
|
|
|
msg4slave_cksum = cksum; |
|
|
|
msg4slave_cksum = cksum; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** called from the main loop, periodically */ |
|
|
|
void gw_handle_usb_out(uint8_t *buffer) |
|
|
|
void gw_process(void) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
static uint8_t buffer[MQ_SLOT_LEN]; |
|
|
|
|
|
|
|
while (mq_read(&usb_rxq, buffer)) { // greedy - handle as many as possible
|
|
|
|
|
|
|
|
dbg("Handling frame."); |
|
|
|
dbg("Handling frame."); |
|
|
|
if (urx_state == URXS_IDLE) { |
|
|
|
if (urx_state == URXS_IDLE) { |
|
|
|
PayloadParser pp = pp_start(buffer, MQ_SLOT_LEN, NULL); |
|
|
|
PayloadParser pp = pp_start(buffer, MQ_SLOT_LEN, NULL); |
|
|
@ -110,6 +107,14 @@ void gw_process(void) |
|
|
|
urx_state = URXS_IDLE; |
|
|
|
urx_state = URXS_IDLE; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** called from the main loop, periodically */ |
|
|
|
|
|
|
|
void gw_process(void) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// static uint8_t buffer[MQ_SLOT_LEN];
|
|
|
|
|
|
|
|
// while (mq_read(&usb_rxq, buffer)) { // greedy - handle as many as possible
|
|
|
|
|
|
|
|
// gw_handle_usb_out(buffer);
|
|
|
|
|
|
|
|
// }
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|