EE445M RTOS
Taken at the University of Texas Spring 2015
|
#include "adcpp.hpp"
#include "blinker.hpp"
#include "uartpp.hpp"
#include "shellpp.hpp"
#include "semaphorepp.hpp"
#include "motorpp.hpp"
#include "drivepp.hpp"
#include "canpp.hpp"
#include "ctlsysctl.hpp"
#include "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 "driverlib/pwm.h"
Go to the source code of this file.
Macros | |
#define | thread(x) |
#define | can_data_length 10 |
#define | UART0_RX_BUFFER_SIZE 8 |
#define | BLINK_RED_WAIT_FOR_SEM 1 |
#define | BLINK_BLUE_WAIT_FOR_SEM 1 |
#define | BLINK_GREEN_WAIT_FOR_SEM 1 |
Functions | |
void | thread_blink_red () |
void | thread_blink_blue () |
void | thread_blink_green () |
void | thread_uart_update () |
void | __cxa_pure_virtual () |
void | UART0_Handler (void) |
void | CAN0_Handler (void) |
void | GPIOPortE_Handler () |
void | switch_responder () |
void | can_handler (void) |
void | shell_handler () |
void | motor_control (void) |
void | Timer1A_Handler () |
void | Timer0A_Handler () |
void | driver (void) |
int | main (void) |
Variables | |
blinker | blink |
uart | uart0 |
shell | shell0 |
uint16_t | sens_ir_left |
uint16_t | sens_ir_left_front |
uint16_t | sens_ir_right |
uint16_t | sens_ir_right_front |
uint16_t | sens_ping_front |
lswitch | switch0 |
semaphore | sem_switch |
timer | countdown_timer |
semaphore | motor_start |
semaphore | motor_stop |
motor | motor0 |
motor | motor1 |
drive | drive0 |
const uint32_t | can_msg_id = 1 |
const bool | can_sender = false |
can | can0 |
uint8_t | can_data [10] |
static semaphore | UART0_RX_SEM |
static buffer< char, 8 > | UART0_RX_BUFFER |
uint32_t | blink_count_red = 0 |
uint32_t | blink_count_green = 0 |
uint32_t | blink_count_blue = 0 |
semaphore | sem_blink_red |
semaphore | sem_blink_blue |
semaphore | sem_blink_green |
#define BLINK_BLUE_WAIT_FOR_SEM 1 |
Definition at line 75 of file move-main.cpp.
#define BLINK_GREEN_WAIT_FOR_SEM 1 |
Definition at line 76 of file move-main.cpp.
#define BLINK_RED_WAIT_FOR_SEM 1 |
Definition at line 74 of file move-main.cpp.
#define can_data_length 10 |
Definition at line 56 of file move-main.cpp.
Referenced by main().
#define thread | ( | x | ) |
Definition at line 32 of file move-main.cpp.
Referenced by thread_uart_update().
#define UART0_RX_BUFFER_SIZE 8 |
Definition at line 62 of file move-main.cpp.
void __cxa_pure_virtual | ( | ) |
Definition at line 131 of file move-main.cpp.
void CAN0_Handler | ( | void | ) |
Definition at line 164 of file move-main.cpp.
References can::ack(), can::error_tx(), semaphore::post(), and can::recv_sem.
void can_handler | ( | void | ) |
Definition at line 213 of file move-main.cpp.
References uart::atomic_printf(), can_data, can_msg_id, can::get(), semaphore::guard(), PIN_BLUE, can::recv_sem, sens_ir_left, sens_ir_left_front, sens_ir_right, sens_ir_right_front, sens_ping_front, and blinker::toggle().
Referenced by main().
void driver | ( | void | ) |
Definition at line 287 of file move-main.cpp.
References sens_ir_left, sens_ir_left_front, sens_ir_right, sens_ir_right_front, sens_ping_front, and drive::steer().
Referenced by main().
void GPIOPortE_Handler | ( | ) |
Definition at line 178 of file move-main.cpp.
References lswitch::ack(), and lswitch::debounce().
int main | ( | void | ) |
Definition at line 296 of file move-main.cpp.
References can_data_length, can_handler(), can_sender, driver(), motor_control(), ctlsys::set_clock(), shell_handler(), switch_responder(), thread_blink_blue(), thread_blink_green(), thread_blink_red(), and UART0_RX_SEM.
void motor_control | ( | void | ) |
Allows motor control from shell
Definition at line 263 of file move-main.cpp.
References semaphore::guard(), drive::start(), and drive::stop().
Referenced by main().
void shell_handler | ( | ) |
Definition at line 248 of file move-main.cpp.
References shell::accept(), buffer< T, N >::get(), and semaphore::guard().
Referenced by main().
void switch_responder | ( | ) |
Definition at line 184 of file move-main.cpp.
References lswitch::debounced_data, semaphore::guard(), drive::reset_history(), and motor::reverse().
Referenced by main().
void thread_blink_blue | ( | ) |
Definition at line 93 of file move-main.cpp.
References blink_count_blue, semaphore::guard(), PIN_BLUE, and blinker::toggle().
Referenced by main().
void thread_blink_green | ( | ) |
Definition at line 108 of file move-main.cpp.
References blink_count_green, semaphore::guard(), PIN_GREEN, and blinker::toggle().
Referenced by main().
void thread_blink_red | ( | ) |
Definition at line 78 of file move-main.cpp.
References blink_count_red, semaphore::guard(), PIN_RED, and blinker::toggle().
Referenced by main().
void thread_uart_update | ( | ) |
Definition at line 123 of file move-main.cpp.
References uart::atomic_printf(), blink_count_blue, blink_count_green, blink_count_red, and thread.
void Timer0A_Handler | ( | ) |
Definition at line 281 of file move-main.cpp.
References timer::ack(), and drive::stop().
void Timer1A_Handler | ( | ) |
Definition at line 276 of file move-main.cpp.
References lswitch::end_debounce().
void UART0_Handler | ( | void | ) |
Definition at line 133 of file move-main.cpp.
References uart::ack(), blinker::blink(), uart::get_char(), uart::LAST_WAS_CR, buffer< T, N >::notify(), and PIN_RED.
blinker blink |
Definition at line 38 of file move-main.cpp.
Referenced by shell::doctor(), shell::jester(), and shell::witch().
uint32_t blink_count_blue = 0 |
Definition at line 68 of file move-main.cpp.
Referenced by thread_blink_blue(), and thread_uart_update().
uint32_t blink_count_green = 0 |
Definition at line 67 of file move-main.cpp.
Referenced by thread_blink_green(), and thread_uart_update().
uint32_t blink_count_red = 0 |
Definition at line 66 of file move-main.cpp.
Referenced by thread_blink_red(), and thread_uart_update().
can can0 |
Definition at line 59 of file move-main.cpp.
uint8_t can_data[10] |
Definition at line 60 of file move-main.cpp.
Referenced by can_handler().
const uint32_t can_msg_id = 1 |
Definition at line 57 of file move-main.cpp.
Referenced by can_handler().
const bool can_sender = false |
Definition at line 58 of file move-main.cpp.
Referenced by can::can(), and main().
timer countdown_timer |
Definition at line 50 of file move-main.cpp.
drive drive0 |
Definition at line 54 of file move-main.cpp.
motor motor0 |
Definition at line 53 of file move-main.cpp.
motor motor1 |
Definition at line 53 of file move-main.cpp.
semaphore motor_start |
Definition at line 52 of file move-main.cpp.
semaphore motor_stop |
Definition at line 52 of file move-main.cpp.
semaphore sem_blink_blue |
Definition at line 71 of file move-main.cpp.
semaphore sem_blink_green |
Definition at line 72 of file move-main.cpp.
semaphore sem_blink_red |
Definition at line 70 of file move-main.cpp.
semaphore sem_switch |
Definition at line 49 of file move-main.cpp.
uint16_t sens_ir_left |
Definition at line 42 of file move-main.cpp.
Referenced by can_handler(), can_transmitter(), and driver().
uint16_t sens_ir_left_front |
Definition at line 43 of file move-main.cpp.
Referenced by can_handler(), can_transmitter(), and driver().
uint16_t sens_ir_right |
Definition at line 44 of file move-main.cpp.
Referenced by can_handler(), can_transmitter(), and driver().
uint16_t sens_ir_right_front |
Definition at line 45 of file move-main.cpp.
Referenced by can_handler(), can_transmitter(), and driver().
uint16_t sens_ping_front |
Definition at line 46 of file move-main.cpp.
Referenced by can_handler(), can_transmitter(), and driver().
shell shell0 |
Definition at line 40 of file move-main.cpp.
lswitch switch0 |
Definition at line 48 of file move-main.cpp.
uart uart0 |
Definition at line 39 of file move-main.cpp.
|
static |
Definition at line 64 of file move-main.cpp.
|
static |
Definition at line 63 of file move-main.cpp.
Referenced by main().