/* Set function for the backlight PWM's duty cycle.  */
void halLcdSetBackLight(unsigned char BackLightLevel)
/* Set function for the backlight PWM's duty cycle.  */
void halLcdSetBackLight(unsigned char BackLightLevel)
{
  unsigned int dutyCycle = 0, i, dummy;
  if (BackLightLevel > 0)
  {
    TA0CCTL3 = OUTMOD_7;
    dummy = (TA0CCR0 >> 4);
    for (i = 0; i < BackLightLevel; i++)
      dutyCycle += dummy;
    TA0CCR3 = dutyCycle;
    if (!backlight)
      TA0CTL |= MC0;
  }
  else
  {       TA0CCTL3 = 0;
    TA0CTL &= ~MC0;
  }
  backlight = BackLightLevel;
}