/* reinitializes LCD if Advanced Energy Monitor was enabled previously 
If user enables AEM on DK, LCD must be reinitialized and redrawn. This function checks AEM state and if detects that it is just disabled, reinitializes LCD controller and redraw LCD content.  */
static void _checkForAEM(void)
/* reinitializes LCD if Advanced Energy Monitor was enabled previously 
If user enables AEM on DK, LCD must be reinitialized and redrawn. This function checks AEM state and if detects that it is just disabled, reinitializes LCD controller and redraw LCD content.  */
static void _checkForAEM(void)
{
  if (BSP_RegisterRead(BC_AEMSTATE) != BC_AEMSTATE_EFM )
    aem_mode = 1;
  else if(aem_mode)
  {
    aem_mode = 0;
    LCD_InitializeDriver();
    WM_InvalidateWindow(WM_HBKWIN);
    WM_ForEachDesc(WM_HBKWIN, _cbInvalidateWindow, (void *)0);
    GUI_Exec();
  }
}