Ejemplo n.º 1
0
void UI::ticks()
{
    D4D_TimeTickPut();
    D4D_CheckTouchScreen();
    D4D_Poll();

    #if BREWPI_BUZZER
	buzzer.setActive(alarm.isActive() && !buzzer.isActive());
    #endif
}
Ejemplo n.º 2
0
Archivo: main.c Proyecto: Gargy007/eGUI
/*LW Timer CallBack*---------------------------------------
* 
* Function Name    : Time_event25ms
* Comments     :
*    This function do: 	periodical events in 25ms
*
*END*-----------------------------------------------------*/
static void Time_event25ms(void* pUser)
{
  static Byte actual_time = 0;
  TIME_FLAGS t_flags;

  D4D_TimeTickPut();
		
  /* set the internal time flags */
  actual_time++;
  t_flags.all = (LWord)(actual_time ^ (actual_time - 1));

  time.all |= t_flags.all;
  
  if(t_flags.bits.b50ms)
    D4D_CheckTouchScreen();
  
  if(t_flags.bits.b100ms)
    time100sm_cnt++;		
}
Ejemplo n.º 3
0
Archivo: main.c Proyecto: Gargy007/eGUI
void lcd_task(uint32_t initial_data)
{
 // MQX_FILE_PTR   adc_file;
  TCHRES_INSTALL_PARAM_STRUCT install_params;
  
  printf("Hello from LCD demo\n\r");     

#if (defined BSP_TCHRES_ADC_XPLUS_DEVICE) && (defined BSP_TCHRES_ADC_YPLUS_DEVICE)
    printf("Opening ADC device for XPLUS electrode ... " BSP_TCHRES_ADC_XPLUS_DEVICE " ");
    if (fopen(BSP_TCHRES_ADC_XPLUS_DEVICE, (const char*)&adc_init) == NULL) {
        printf("failed\n");
        _task_block();
    } else {
        install_params.ADC_XPLUS_DEVICE = BSP_TCHRES_ADC_XPLUS_DEVICE;
        printf("done\n");
    }

    printf("Opening ADC device for YPLUS electrode ... " BSP_TCHRES_ADC_YPLUS_DEVICE " ");
    if (fopen(BSP_TCHRES_ADC_YPLUS_DEVICE, (const char*)&adc_init) == NULL) {
        printf("failed\n");
        _task_block();
    } else {
        install_params.ADC_YPLUS_DEVICE = BSP_TCHRES_ADC_YPLUS_DEVICE;
        printf("done\n");
    }
#elif (defined BSP_TCHRES_ADC_DEVICE)
    printf("Opening ADC device for XPLUS and YPLUS electrodes ... " BSP_TCHRES_ADC_DEVICE " ");
    if (fopen(BSP_TCHRES_ADC_DEVICE, (const char*)&adc_init) == NULL) {
        printf("failed\n");
        _task_block();
    } else {
        install_params.ADC_XPLUS_DEVICE = install_params.ADC_YPLUS_DEVICE = BSP_TCHRES_ADC_DEVICE;
        printf("done\n");
    }
#else
    printf("This demo application requires ADC devices for TCHRES to be defined!\n");
    _task_block();
#endif
  
  #if ADC_IOCTL_CALIBRATE   
//    ioctl( adc_file, ADC_IOCTL_CALIBRATE, NULL );
  #endif

  _io_tchres_install("tchscr:", &_bsp_tchscr_resisitve_init, &install_params );

  // Create the lwtimer component
  _lwtimer_create_periodic_queue(&lwt_ps, 25 / 5, 40);
  _lwtimer_add_timer_to_queue(&lwt_ps, &lwt_st25, 0, Time_event25ms, 0);

  if(!D4D_Init(&screen_entry))
  {
    // D4D initialization failed
    printf("eGUI/D4D initialization failed\n\r");   
    _mqx_exit(0);
  }

  D4D_SetOrientation(D4D_ORIENT_LANDSCAPE);

  D4D_CheckTouchScreen();

  for(;;)
  {
    D4D_Poll();
    _time_delay(10);
  }
}