A porting of a GPS decoding and presenting program within the mbos RTOS. It is not a definitive application but a study program to test NMEA full decoding library and a first approach to an RTOS. Many thanks to Andrew Levido for his support and his patience on teaching me the RTOS principles from the other side of the Earth. It uses NMEA library by Tim (xtimor@gmail.com) ported by Ken Todotani (http://mbed.org/users/todotani/) on public mbed library (http://mbed.org/users/todotani/programs/GPS_nmeaLib/5yo4h) also available, as original universal C library, on http://nmea.sourceforge.net

Dependencies:   mbos Watchdog TextLCD mbed ConfigFile

Task7Dim.cpp

Committer:
guiott
Date:
2012-02-03
Revision:
3:a2f9eb3b8a16
Parent:
2:8917036cbf69

File content as of revision 3:a2f9eb3b8a16:

#include "Task7Dim.h"

void LcdLightDimTask(void)
{/** 
 *\brief TASK 7, control the LCD backlight intensity to smoothly
         switch it on or off
 */
 static float LightVal=1;
        
 while(1)
 {       
    os.WaitEvent(LCD_LIGHT_DIM_ON_EVT | LCD_LIGHT_DIM_OFF_EVT); 
    if(os.GetEvent()==LCD_LIGHT_DIM_ON_EVT)
    {
      if(LightVal<1)
      {
        for (LightVal=0; LightVal<=1; LightVal+=0.01f)
        {
            LcdBklight=LightVal;
            wait_ms(10);
        }
      }
    // Set the timer for the power saving backlight switch off
    os.ClearTimer(LCD_LIGHT_DIM_OFF_TMR);
    os.SetTimer(LCD_LIGHT_DIM_OFF_TMR, LCD_LIGHT_DIM_TIMER, 0);
    }
    else if(os.GetEvent()==LCD_LIGHT_DIM_OFF_EVT)
    {// The dimming off is slower than lighting up
        for (LightVal=1; LightVal>=0; LightVal-=0.01f)
        {
            LcdBklight=LightVal;           
            wait_ms(30);
        }        
    }
 }
}