143,6 → 143,15 |
LED3_LAT = 0; |
LED4_LAT = 0; |
|
// Determine what to do at this point. We either choose to idle (on POR) |
// or go into a mode specified prior to the software reset event |
uint8_t last_reset = Get_Reset_Condition(); |
if (last_reset == RESET_POR || last_reset == RESET_BOR || |
last_reset == RESET_PIN || last_reset == RESET_WDT || |
last_reset == RESET_CFG) { |
op_state = BOARD_MODE_IDLE; |
} |
|
// Initialize the SPI1 module |
SPI1_DATA spi_1_data; |
SPI1_Init(&spi_1_data, NULL); |
174,7 → 183,6 |
// Start the controller polling and overlay rotation interrupt |
TIMER4_DATA timer_4_data; |
TIMER4_Init(&timer_4_data, &Controller_Update, NULL, 0); |
// TIMER4_Init(&timer_4_data, NULL, NULL, 0); |
|
// Process button inputs |
BTN_DATA btn_data; |
191,15 → 199,6 |
SNAKE_DATA snake_data; |
TRON_DATA tron_data; |
|
// Determine what to do at this point. We either choose to idle (on POR) |
// or go into a mode specified prior to the software reset event |
uint8_t last_reset = Get_Reset_Condition(); |
if (last_reset == RESET_POR || last_reset == RESET_BOR || |
last_reset == RESET_PIN || last_reset == RESET_WDT || |
last_reset == RESET_CFG) { |
op_state = BOARD_MODE_IDLE; |
} |
|
PWM2_Start(); |
TIMER5_Start(); |
TIMER4_Start(); |
207,6 → 206,7 |
/* -------------------- END OF INITIALIZATION -------------------- */ |
/* ------------------------ BEGIN DISPLAY ------------------------ */ |
|
// Figure out what state to go into here |
switch (op_state) { |
case BOARD_MODE_IDLE: |
Idle_Animation_Sequence(); |
227,8 → 227,6 |
break; |
} |
|
while(1); |
|
} |
|
void Idle_Animation_Sequence(void) { |
250,7 → 248,7 |
// Start the scrolling text |
TIMER4_Stop(); |
TIMER4_Init(NULL, &Controller_Update, &Cube_Text_Interrupt, 100); |
TIMER4_Start(); |
// TIMER4_Start(); |
|
// int8_t start_text[] = "Cube Initialized\r\n"; |
// UART1_Write(start_text, 18); |