EE445M RTOS
Taken at the University of Texas Spring 2015
uart.c File Reference

Go to the source code of this file.

Functions

void s_Handler (void)
 

Function Documentation

void s_Handler ( void  )

s isr responsible for notifying all subscriptions with information describing the interrupt.

This isr was generated automatically by bin/lisp/rtos-interrupt-generator.el

Definition at line 7 of file uart.c.

References notification::_char, hw_uart_metadata::channel, hw_notify(), HW_UART, hw_metadata::uart, uart_get_char(), UARTCharsAvail(), and UARTIntStatus().

7  {
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
char _char
Definition: notify.h:25

Here is the call graph for this function: