EE445M RTOS
Taken at the University of Texas Spring 2015
uart.c
Go to the documentation of this file.
1 
7 void %s_Handler(void) {
8 
9  unsigned short i;
10  notification note;
11  hw_metadata metadata;
12 
13  /* TODO: determine which bit to clear: */
14  unsigned long look_at_me = UARTIntStatus();
15  /* UARTIntClear(%s_BASE, ); */
16 
17  metadata.uart.channel = %s_BASE;
18 
19  while(UARTCharsAvail(%s_BASE)) {
20 
21  /* Notify every subscribed task of each incoming character
22  * (but schedule them for later so we can return from this ISR
23  * asap). */
24  note._char = uart_get_char();
25 
26  /* TODO: schedule this thread instead of running it immediately */
27  hw_notify(HW_UART, metadata, note);
28  }
29 }
void hw_notify(HW_TYPE type, hw_metadata metadata, notification note)
Definition: hardware.c:149
char uart_get_char()
Read a char from the active uart channel.
Definition: uart.c:87
bool UARTCharsAvail(uint32_t ui32Base)
Definition: uart.c:1087
hw_uart_metadata uart
Definition: hardware.h:97
memory_address_t channel
Definition: hardware.h:56
uint32_t UARTIntStatus(uint32_t ui32Base, bool bMasked)
Definition: uart.c:1533
void s_Handler(void)
Definition: uart.c:7
char _char
Definition: notify.h:25