Exemple #1
0
INT32 ali_ipanel_exit_mw()
{
	INT32 ret = SUCCESS;
	UINT32 flag_value = 0;
	struct dmx_device *dmx = (struct dmx_device*)dev_get_by_id(HLD_DEV_TYPE_DMX, 0);
	struct vpo_device *vpo_dev = (struct vpo_device*)dev_get_by_id(HLD_DEV_TYPE_DIS, 0);

	if (ali_ipanel_flag_id == OSAL_INVALID_ID)
	{
		IPANEL_PRINTF("%s() ali_ipanel_flag_id invalid! \n", __FUNCTION__);
		return  - 1;
	}
	
	//start dmx, ipanel porting stopped dmx and changed buff mode
	dmx_io_control(dmx, DMX_SWITCH_TO_UNI_BUF, 0);
	dmx_io_control(dmx, DMX_CHANGE_THLD, (0 << 16) | (16));
	dmx_start(dmx);

	//open vpo
	vpo_win_onoff(vpo_dev, TRUE);

	//open sie
/*	if (SUCCESS != sie_open(dmx, PSI_MODULE_CONCURRENT_FILTER, NULL, 0))
	{
		IPANEL_PRINTF("%s() sie_open failed! \n", __FUNCTION__);
		return  - 1;
	}*/

	//resum key task
	key_task_resume();

	//suspend ota task
	ota_task_resume();

	//start tdt
	start_tdt();

       sdt_monitor_on(0);

	//set flag to enable ali application
	ALI_IPANEL_LEAVE_MUTEX(ALI_IPANEL_FLAG_EXIT_MW);
	return ret;
}
Exemple #2
0
int
main(void)
{
  wdt_disable();

  // un-reset ethernet
  ENC28J60_RESET_DDR  |= _BV( ENC28J60_RESET_BIT );
  ENC28J60_RESET_PORT |= _BV( ENC28J60_RESET_BIT );

  MARK433_PORT |= _BV( MARK433_BIT ); // Pull 433MHz marker
  MARK915_PORT |= _BV( MARK915_BIT ); // Pull 915MHz marker
  
  led_init();
  LED_ON();

  spi_init();

  eeprom_init();
  
  // Reset the "Request Bootloader" flag in EEPROM, to avoid a permanent loop
  eeprom_update_byte( EE_REQBL, 0);

// Setup OneWire and make a full search at the beginning (takes some time)
#ifdef HAS_ONEWIRE
  i2c_init();
  onewire_Init();
  onewire_FullSearch();
#endif

  // Setup the timers. Are needed for watchdog-reset

#if defined (HAS_IRRX) || defined (HAS_IRTX)
  ir_init();
  // IR uses highspeed TIMER0 for sampling 
  OCR0A  = 1;                              // Timer0: 0.008s = 8MHz/256/2   == 15625Hz Fac: 125
#else
  OCR0A  = 249;                            // Timer0: 0.008s = 8MHz/256/250 == 125Hz
#endif

  TCCR0B = _BV(CS02);
  TCCR0A = _BV(WGM01);
  TIMSK0 = _BV(OCIE0A);

  TCCR1A = 0;
  TCCR1B = _BV(CS11) | _BV(WGM12);         // Timer1: 1us = 8MHz/8

  clock_prescale_set(clock_div_1);

  MCUSR &= ~(1 << WDRF);                   // Enable the watchdog
  wdt_enable(WDTO_2S);

  uart_init( UART_BAUD_SELECT_DOUBLE_SPEED(UART_BAUD_RATE,F_CPU) );

  fht_init();
  tx_init();
  input_handle_func = analyze_ttydata;
#ifdef HAS_RF_ROUTER
  rf_router_init();
  display_channel = (DISPLAY_USB|DISPLAY_RFROUTER);
#else
  display_channel = DISPLAY_USB;
#endif

#ifdef HAS_VZ
  vz_init();
#endif

  ethernet_init();
    
  LED_OFF();

#ifdef HAS_DMX
#ifdef DMX_CHANNELS
  dmx_initialize(DMX_CHANNELS);
#else
  dmx_initialize(16);
#endif
#endif

#ifdef HAS_HM485
  hm485_initialize();
#endif

#ifdef HAS_HELIOS
  helios_initialize();
#endif

#ifdef HAS_CUNOTTY
rf_cunotty_init();
#endif

  sei();

#ifdef HAS_DMX
  dmx_start();
#endif

  for(;;) {
    uart_task();
    RfAnalyze_Task();
    Minute_Task();
#ifdef HAS_FASTRF
    FastRF_Task();
#endif
#ifdef HAS_RF_ROUTER
    rf_router_task();
#endif
#ifdef HAS_CUNOTTY
	rf_cunotty_task();
#endif
#ifdef HAS_ASKSIN
    rf_asksin_task();
#endif
#ifdef HAS_IRRX
    ir_task();
#endif
#ifdef HAS_ETHERNET
    Ethernet_Task();
#endif
#ifdef HAS_VZ
    vz_task();
#endif
#ifdef HAS_MORITZ
    rf_moritz_task();
#endif
#ifdef HAS_HM485
    hm485_task();
#endif    
#ifdef HAS_HELIOS
    helios_task();
#endif    
  }

}