EE445M RTOS
Taken at the University of Texas Spring 2015
test-countdown.cpp File Reference
#include "../common/adcpp.hpp"
#include "../common/blinker.hpp"
#include "../common/uartpp.hpp"
#include "../common/shellpp.hpp"
#include "../common/semaphorepp.hpp"
#include "../common/motorpp.hpp"
#include "../common/drivepp.hpp"
#include "../common/canpp.hpp"
#include "../common/ctlsysctl.hpp"
#include "../common/switchpp.hpp"
#include "libos/os.h"
#include "libschedule/schedule.h"
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
#include "inc/hw_memmap.h"
#include "driverlib/adc.h"
#include "driverlib/sysctl.h"
#include "driverlib/gpio.h"
#include "driverlib/interrupt.h"
#include "driverlib/uart.h"
Include dependency graph for test-countdown.cpp:

Go to the source code of this file.

Macros

#define UART0_RX_BUFFER_SIZE   8
 

Functions

void timer_updater ()
 
int main (void)
 
void Timer2A_Handler ()
 
void Timer1A_Handler ()
 
void __cxa_pure_virtual ()
 

Variables

timer countdown_timer
 
timer blink_timer
 
blinker blink
 
uart uart0
 
static semaphore UART0_RX_SEM
 
static buffer< char, 8 > UART0_RX_BUFFER
 

Macro Definition Documentation

#define UART0_RX_BUFFER_SIZE   8

Definition at line 36 of file test-countdown.cpp.

Function Documentation

void __cxa_pure_virtual ( )

Definition at line 82 of file test-countdown.cpp.

82 { while (1) {} }
int main ( void  )

Definition at line 51 of file test-countdown.cpp.

References ctlsys::set_clock(), timer_updater(), and UART0_RX_SEM.

51  {
52 
54  IntMasterDisable();
55 
56  blink = blinker(GPIO_PORTF_BASE, GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3);
57 
59  uart0 = uart(UART0_BASE, INT_UART0);
60 
61  countdown_timer = timer(2, TIMER_BOTH, TIMER_CFG_ONE_SHOT,
62  SysCtlClockGet()*180, TIMER_TIMA_TIMEOUT, true);
63 
64  blink_timer = timer(1, TIMER_A, TIMER_CFG_PERIODIC,
65  SysCtlClockGet()/2, TIMER_TIMA_TIMEOUT, true);
66 
67  os_threading_init();
68  schedule(timer_updater, 200);
69  os_launch();
70 }
timer blink_timer
static buffer< char, 8 > UART0_RX_BUFFER
Definition: uartpp.hpp:28
timer countdown_timer
uart uart0
static semaphore UART0_RX_SEM
static void set_clock(void)
Definition: ctlsysctl.hpp:109
blinker blink
void timer_updater()

Here is the call graph for this function:

void Timer1A_Handler ( )

Definition at line 77 of file test-countdown.cpp.

References timer::ack(), PIN_GREEN, and blinker::toggle().

77  {
78  blink_timer.ack();
80 }
timer blink_timer
virtual uint32_t ack()
Definition: timerpp.cpp:74
virtual void toggle(pin_t pin)
Definition: blinker.cpp:34
const pin_t PIN_GREEN
Definition: blinker.hpp:19
blinker blink

Here is the call graph for this function:

void Timer2A_Handler ( )

Definition at line 72 of file test-countdown.cpp.

References timer::ack(), PIN_RED, and blinker::toggle().

72  {
75 }
timer countdown_timer
const pin_t PIN_RED
Definition: blinker.hpp:18
virtual uint32_t ack()
Definition: timerpp.cpp:74
virtual void toggle(pin_t pin)
Definition: blinker.cpp:34
blinker blink

Here is the call graph for this function:

void timer_updater ( )

Definition at line 40 of file test-countdown.cpp.

References uart::printf().

Referenced by main().

40  {
41  uint32_t timer_data;
42 
43  while(1) {
44  /* todo: populate these uint32_t's with sensor data */
45  timer_data = TimerValueGet(TIMER2_BASE, TIMER_A);
46  uart0.printf("timer: %u\n", timer_data);
47  os_surrender_context();
48  }
49 }
void printf(const char *pcString,...)
Definition: uartpp.cpp:360
uart uart0

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

blinker blink

Definition at line 33 of file test-countdown.cpp.

timer blink_timer

Definition at line 32 of file test-countdown.cpp.

timer countdown_timer

Definition at line 31 of file test-countdown.cpp.

uart uart0

Definition at line 34 of file test-countdown.cpp.

buffer<char, 8 > UART0_RX_BUFFER
static

Definition at line 38 of file test-countdown.cpp.

semaphore UART0_RX_SEM
static

Definition at line 37 of file test-countdown.cpp.

Referenced by main().