void FrequencyManager_StepFrequencyDown(void) { uint32_t newFreq = FrequencyManager_GetCurrentFrequency() - s_stepSize; FrequencyManager_SetCurrentFrequency(newFreq); FrequencyManager_Check_FilterBand(newFreq); // FrequencyManager_DisplayFrequency(); }
void FrequencyManager_SaveCurrentFrequency(void){ debug(GUI, "FrequencyManager_SaveCurrentFrequency:\n"); s_bandsData[s_selectedBand].Setpoint =FrequencyManager_GetCurrentFrequency(); UserModeType newMode = Mode_GetCurrentUserMode(); s_bandsData[s_selectedBand].Mode = newMode; FrequencyManager_WriteBandsToEeprom(); }
static void insideDrawHandler(GL_PageControls_TypeDef* pThis, _Bool force, int relX, int relY) { // Setup impossible values (as much as possible static BandPreset previousBand = -1; static uint32_t previousFreq = -1; static uint32_t previousStep = -1; BandPreset curBand = FrequencyManager_GetSelectedBand(); uint32_t curFreq = FrequencyManager_GetCurrentFrequency(); uint32_t curStep = FrequencyManager_GetFrequencyStepSize(); // Redraw only when needed: _Bool redrawBand = force || curBand != previousBand; _Bool redrawFreq = force || curFreq != previousFreq || curStep != previousStep; // Draw the band if (redrawBand) { GL_SetFont(GL_FONTOPTION_8x12Bold); GL_SetTextColor(BIGBUTTON_COLOR_NORMAL_TEXT); GL_SetBackColor(BIGBUTTON_COLOR_NORMAL_BACK); int writeX = relX + OFFSETX_TEXT; int writeY = relY + OFFSETY_BAND; GL_PrintString(writeX, writeY, FrequencyManager_GetBandName(FrequencyManager_GetSelectedBand()), 0); previousBand = curBand; } // Draw the Frequency if (redrawFreq) { GL_SetFont(GL_FONTOPTION_8x12Bold); GL_SetTextColor(BIGBUTTON_COLOR_EDIT_TEXT); GL_SetBackColor(BIGBUTTON_COLOR_EDIT_BACK); int writeX = relX + OFFSETX_TEXT; int writeY = relY + OFFSETY_FREQ; displayFrequency(FrequencyManager_GetCurrentFrequency(), writeX, writeY, FrequencyManager_GetFrequencyStepSize()); previousFreq = curFreq; previousStep = curStep; } }
void FrequencyManager_StepFrequencyDown(void) { uint32_t newFreq = FrequencyManager_GetCurrentFrequency() - s_stepSize; FrequencyManager_SetCurrentFrequency(newFreq); }