Beispiel #1
0
//*****************************************************************************
//
// Called by the NVIC as a result of SysTick Timer rollover interrupt flag
//
// Checks buttons and calls AppButtonHandler to manage button events.
// Tracks time and auto mode color stepping.  Calls AppRainbow to implement
// RGB color changes.
//
//*****************************************************************************
void
SysTickIntHandler(void)
{

    static float x;

    g_sAppState.ui32Buttons = ButtonsPoll(0,0);
    AppButtonHandler();

    //
    // Auto increment the color wheel if in the AUTO mode. AUTO mode is when
    // device is active but user interaction has timed out.
    //
    if(g_sAppState.ui32Mode == APP_MODE_AUTO) {
        g_sAppState.fColorWheelPos += APP_AUTO_COLOR_STEP;
    }

    //
    // Provide wrap around of the control variable from 0 to 1.5 times PI
    //
    if(g_sAppState.fColorWheelPos > (APP_PI * 1.5f)) {
        g_sAppState.fColorWheelPos = 0.0f;
    }
    if(x < 0.0f) {
        g_sAppState.fColorWheelPos = APP_PI * 1.5f;
    }

    //
    //    Set the RGB Color based on current control variable value.
    //
    AppRainbow(0);


}
Beispiel #2
0
void
SysTickIntHandler(void)
{


    g_sAppState.ulButtons = ButtonsPoll(0,0);
    AppButtonHandler();



}