Skip to content

Commit

Permalink
uart bridge: try to reduce latency.
Browse files Browse the repository at this point in the history
Start sending to the network immediately when data arrives at the UART.
Don't wait for the next slow timer to fire.
  • Loading branch information
eriksl committed Apr 22, 2019
1 parent 8265914 commit e156d35
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dispatch.c
Expand Up @@ -52,7 +52,7 @@ string_new(static, uart_socket_receive_buffer, 128);
string_new(static, uart_socket_send_buffer, 128);
static lwip_if_socket_t uart_socket;

static bool uart_bridge_active = false;
bool uart_bridge_active = false;

static os_timer_t fast_timer;
static os_timer_t slow_timer;
Expand Down
2 changes: 2 additions & 0 deletions dispatch.h
Expand Up @@ -36,6 +36,8 @@ typedef enum
fsb_sequencer,
} flash_sector_buffer_use_t;

extern bool uart_bridge_active;

extern string_t flash_sector_buffer;
extern flash_sector_buffer_use_t flash_sector_buffer_use;

Expand Down
4 changes: 4 additions & 0 deletions uart.c
Expand Up @@ -203,6 +203,10 @@ void uart_task(struct ETSEventTag *event)
case(uart_task_fetch_fifo):
{
fetch_queue(0);

if(uart_bridge_active)
dispatch_post_command(command_task_uart_bridge);

break;
}

Expand Down

0 comments on commit e156d35

Please sign in to comment.