Esempio n. 1
0
/**
 * This function gets a temperature reading.
 * @param uTempInParams Denotes the temerature units, Celsius or Fahrenheit
 * @param uTempOutParams Denotes the temerature value
 * @return no return value
 */
void HttpDynamicHandler_GetWheelValue(inputParams uWheelInParams, outputParams *uWheelOutParams)
{
  uWheelOutParams->sWheelParam.uLedDummyOut   = GetLEDStatus();
  uWheelOutParams->sWheelParam.uLedDummyOut   = uWheelOutParams->sWheelParam.uLedDummyOut >> 3;
  uWheelOutParams->sWheelParam.uWheelPosition = Wheel_getPosition();
  uWheelOutParams->sWheelParam.uWheelValue    = Wheel_getValue();
}
Esempio n. 2
0
uint8_t Menu_active(char **menuText, uint8_t numItems)
{
    uint8_t i;
    uint8_t position = 0;
    uint8_t lastPosition = 9;

    if (numItems > 7){                                              // Screen is 8 lines tall = 1
                                                                    // title line + 7 items max
        numItems = 7;
    }
    Dogs102x6_clearImage(numItems + 1, 102, 0, 0);
    Dogs102x6_stringDraw(0, 0, menuText[0], DOGS102x6_DRAW_NORMAL); // Print the title

    buttonsPressed = 0;
    while (!buttonsPressed)                                         // Menu active until selection
                                                                    // is made
    {
        position = Wheel_getPosition();
        if (position > numItems){
            position = numItems;
        }
        else if (position == 0){
            position = 1;
        }
        if (position != lastPosition)                               // Update position if it is
                                                                    // changed
        {
            for (i = 1; i < numItems + 1; i++)                      // Display menu items
            {
                if (i != position){
                    Dogs102x6_stringDraw(i, 0, menuText[i], DOGS102x6_DRAW_NORMAL);
                }
                else {
                    // Highlight item at current position
                    Dogs102x6_stringDraw(i, 0, menuText[i], DOGS102x6_DRAW_INVERT);
                }
            }
            lastPosition = position;
        }  
    }
    
    return position;
}