31 #include "../INC/main.h"
48 if (OS_NO_ERR != err) {
49 error(
"INPUT_FLAG_CREATE_ERR: %i\n", err);
52 if (OS_NO_ERR != err) {
53 error(
"HEARTBEAT_FLAG_CREATE_ERR: %i\n", err);
56 if (OS_NO_ERR != err) {
57 error(
"OUTPUT_FLAG_CREATE_ERR: %i\n", err);
64 if (OS_NO_ERR != err) {
65 error(
"Err creating UserInputTask: %i\n", err);
72 if (OS_NO_ERR != err) {
73 error(
"Err creating UserInputTask: %i\n", err);
80 if (OS_NO_ERR != err) {
81 error(
"Err creating HeartbeatTask: %i\n", err);
85 alt_ic_isr_register(PIO_KEY_IRQ_INTERRUPT_CONTROLLER_ID, PIO_KEY_IRQ,
87 alt_ic_irq_enable(PIO_KEY_IRQ_INTERRUPT_CONTROLLER_ID, PIO_KEY_IRQ);
95 alt_ic_isr_register(PIO_SW_IRQ_INTERRUPT_CONTROLLER_ID, PIO_SW_IRQ,
97 alt_ic_irq_enable(PIO_SW_IRQ_INTERRUPT_CONTROLLER_ID, PIO_SW_IRQ);
105 alt_ic_isr_register(REGISTERS_IRQ_INTERRUPT_CONTROLLER_ID, REGISTERS_IRQ,
107 alt_ic_irq_enable(REGISTERS_IRQ_INTERRUPT_CONTROLLER_ID, REGISTERS_IRQ);
111 if (OS_NO_ERR != err) {
112 error(
"IPC_GLOB_VAR_ERR: %i\n", err);
static __inline__ void PIO_KEY_SetIRMsk(uint32_t enablebits)
Function to enable interrupts for pio key.
#define PIO_KEY_MINUS_IR2_MSK
Increase steps mask for PIO-Key.
#define PIO_KEY_PLUS_IR3_MSK
Decreses steps mask for PIO-Key.
OS_STK UserInputTask_Stk[TASK_STACKSIZE]
Stack for Task 1.
#define PIO_KEY_RS_IR0_MSK
Run/Stop mask for PIO-Key.
#define USER_INPUT_TASK_PRIORITY
lower numbers mean higher priority
#define error(...)
Prints the Error-messages in the terminal.
#define PIO_SW_DEBUG_MSK
Debug mask for PIO-Switches.
OS_FLAG_GRP * userOutputTaskFlagsGrp
The flags group used in the user-output-task.
#define PIO_SW_MODE_MSK
Mode mask for PIO-Switches.
void keysIRQhandler(void *context)
IRQ-Handler for key-input.
uint32_t ISRcontext
Variable for ISR-Context.
OS_FLAG_GRP * userInputTaskFlagsGrp
The flags group used in the user-input-task.
static __inline__ void PIO_KEY_ClearEdgeCptBits(uint32_t clearbits)
Function to clear bits of keys edgecapture register.
#define HEARTBEAT_TASK_PRIORITY
OS_STK UserOutputTask_Stk[TASK_STACKSIZE]
Stack for Task 2.
void UserOutputTask(void *pdata)
UserOutputTask.
void init_term(void)
Initializes terminal output.
static __inline__ void PIO_SW_SetIRMsk(uint32_t enablebits)
Function to enable interrupts for pio sw.
void motorIRQhandler(void *context)
IRQ-Handler for motor stopped.
OS_FLAG_GRP * heartbeatTaskFlagsGrp
The flags group used in the heartbeat-task and user-input-task.
uint8_t init_outputTaskDataTxRx(void)
Initializes the interprocess communication between OutputTask and InputTask.
#define PIO_SW_LR_MSK
Left/Right mask for PIO-Switches.
void HeartbeatTask(void *pdata)
The task for the hearbeat and the debug-mode.
OS_STK HeartbeatTask_Stk[TASK_STACKSIZE]
Stack for Task 3.
void switchesIRQhandler(void *context)
IRQ-Handler for switches.
int main(void)
Main-Routine.
#define TASK_STACKSIZE
Definition of Task Stacks.
#define USER_OUTPUT_TASK_PRIORITY