Subversion Repositories Code-Repo

Rev

Rev 240 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 240 Rev 241
Line 45... Line 45...
45
#include "CUBE.h"
45
#include "CUBE.h"
46
#include "BTN.h"
46
#include "BTN.h"
47
#include "ANIMATIONS.h"
47
#include "ANIMATIONS.h"
48
#include "CONTROLLERS.h"
48
#include "CONTROLLERS.h"
49
#include "SNAKE.h"
49
#include "SNAKE.h"
-
 
50
#include "TRON.h"
50
 
51
 
51
void BTN1_Interrupt(void);
52
void BTN1_Interrupt(void);
52
void BTN2_Interrupt(void);
53
void BTN2_Interrupt(void);
53
void BTN3_Interrupt(void);
54
void BTN3_Interrupt(void);
54
 
55
 
Line 177... Line 178...
177
    BTN_DATA btn_data;
178
    BTN_DATA btn_data;
178
    BTN_Init(&btn_data, &BTN1_Interrupt, &BTN2_Interrupt, NULL);
179
    BTN_Init(&btn_data, &BTN1_Interrupt, &BTN2_Interrupt, NULL);
179
 
180
 
180
    // Initialize controllers
181
    // Initialize controllers
181
    CONTROLLER_DATA ctrl_data;
182
    CONTROLLER_DATA ctrl_data;
182
    Controller_Init(&ctrl_data, &Snake_Update_Direction);
183
    Controller_Init(&ctrl_data, NULL);
183
    
184
    
184
    SNAKE_DATA snake_data;
185
    SNAKE_DATA snake_data;
-
 
186
    TRON_DATA tron_data;
185
 
187
 
186
    // Determine what to do at this point. We either choose to idle (on POR)
188
    // Determine what to do at this point. We either choose to idle (on POR)
187
    // or go into a mode specified prior to the software reset event
189
    // or go into a mode specified prior to the software reset event
188
    uint8_t last_reset = Get_Reset_Condition();
190
    uint8_t last_reset = Get_Reset_Condition();
189
    switch (last_reset) {
191
    switch (last_reset) {
Line 203... Line 205...
203
    
205
    
204
    /* -------------------- END OF INITIALIZATION -------------------- */
206
    /* -------------------- END OF INITIALIZATION -------------------- */
205
    /* ------------------------ BEGIN DISPLAY ------------------------ */
207
    /* ------------------------ BEGIN DISPLAY ------------------------ */
206
    
208
    
207
    switch (op_state.cube_mode) {
209
    switch (op_state.cube_mode) {
208
        case BOARD_MODE_SNAKE:
210
        case BOARD_MODE_SNAKE:;
-
 
211
            Controller_Init(&ctrl_data, &Snake_Update_Direction);
209
            Snake_Init(&snake_data);
212
            Snake_Init(&snake_data);
210
            Snake_Main();
213
            Snake_Main();
211
            break;
214
            break;
212
        case BOARD_MODE_TRON:
215
        case BOARD_MODE_TRON:
-
 
216
            Controller_Init(&ctrl_data, &Tron_Update_Direction);
-
 
217
            Tron_Init(&tron_data);
213
            while(1);
218
            Tron_Main();
214
            break;
219
            break;
215
        case BOARD_MODE_IDLE:
220
        case BOARD_MODE_IDLE:
216
        default:
221
        default:
217
            Idle_Animation_Sequence();
222
            Idle_Animation_Sequence();
218
            break;
223
            break;