コード例 #1
0
ファイル: menus.c プロジェクト: PhamVanNhi/ECE5770
//*****************************************************************************
//
// Get the state defined by the configuration menu items.
// This function will query the configuration menus to determine the current
// choices for channels, period, etc.  These will be stored in the structure
// that was passed to the function.
//
//*****************************************************************************
void
MenuGetState(tConfigState *psState)
{
    int32_t ui32Temp;

    //
    // Check the arguments
    //
    ASSERT(psState);

    if(!psState)
    {
        return;
    }

    //
    // Read the various configuration menus and store their state
    //
    if(SlideMenuFocusItemGet(&g_sSleepMenu) > 0)
    {
        psState->bSleep = true;
    }
    else
    {
        psState->bSleep = false;
    }
    ui32Temp = SlideMenuFocusItemGet(&g_sStorageMenu);;
    psState->ui8Storage = (uint8_t)ui32Temp;
    ui32Temp = SlideMenuSelectedGet(&g_sChannelsMenu);
    psState->ui16SelectedMask = (uint16_t)ui32Temp;
    ui32Temp = g_pui32LogPeriod[SlideMenuFocusItemGet(&g_sPeriodMenu)];
    psState->ui32Period = ui32Temp;
}
コード例 #2
0
//*****************************************************************************
//
// Get the state defined by the configuration menu items.
// This function will query the configuration menus to determine the current
// choices for channels, period, etc.  These will be stored in the structure
// that was passed to the function.
//
//*****************************************************************************
void
MenuGetState(tConfigState *pState)
{
    //
    // Check the arguments
    //
    ASSERT(pState);

    //
    // Read the various configuration menus and store their state
    //
    if(pState)
    {
        pState->bSleep = (unsigned char)SlideMenuFocusItemGet(&g_sSleepMenu);
        pState->ucStorage = (unsigned char)
                                   SlideMenuFocusItemGet(&g_sStorageMenu);
        pState->usSelectedMask = (unsigned short)
                                        SlideMenuSelectedGet(&g_sChannelsMenu);
        pState->ulPeriod = g_ulLogPeriod[SlideMenuFocusItemGet(&g_sPeriodMenu)];
    }
}