예제 #1
0
static portTASK_FUNCTION(AppTask, pvParameters) {
  (void)pvParameters; /* not used */
  RTC1_TTIME time;
  RTC1_TDATE date;

  if (RTC1_GetRTCTimeDate(&time, &date)==ERR_OK) {
    TmDt1_SetDate((uint16_t)date.year+2000, date.month, date.day);
    TmDt1_SetTime(time.hour, time.min, time.sec, 0);
  } else {
    for(;;) {} /* error */
  }
  (void)NEO_ClearAllPixel();
  (void)NEO_TransferPixels();
#if HAS_CLOCK
  (void)NEOL_PixelTrail(0x00, 0x00, 0xFF, NEO_PIXEL_FIRST, NEO_PIXEL_LAST,  8, 25, 20);
  (void)NEOL_PixelTrail(0x00, 0xff, 0x00, NEO_PIXEL_FIRST, NEO_PIXEL_LAST,  16, 25, 15);
  (void)NEOL_PixelTrail(0x00, 0x50, 0xff, NEO_PIXEL_FIRST, NEO_PIXEL_LAST,  16, 25, 10);

  CLOCK_Init();
#endif
  for(;;) {
#if HAS_ELEVATOR
    Elevator();
    FRTOS1_vTaskDelay(1000/portTICK_RATE_MS);
#else
    CLOCK_Update();
    FRTOS1_vTaskDelay(50/portTICK_RATE_MS);
#endif
  } /* for */
}
예제 #2
0
void Init() {
    PWR_Init();
    CLOCK_Init();
    UART_Initialize();
    printf("Start\n");
    Initialize_ButtonMatrix();
    SPIFlash_Init(); //This must come before LCD_Init() for 7e

    LCD_Init();
    CHAN_Init();

    SPITouch_Init();
    SOUND_Init();
    BACKLIGHT_Init();
    BACKLIGHT_Brightness(1);
    AUTODIMMER_Init();
    SPI_FlashBlockWriteEnable(1); //Enable writing to all banks of SPIFlash

    PPMin_TIM_Init();
#ifdef MODULAR
    //Force protocol to none to initialize RAM
    Model.protocol = PROTOCOL_NONE;
    PROTOCOL_Init(1);
#endif
#if HAS_RTC
    RTC_Init();        // Watchdog must be running in case something goes wrong (e.g no crystal)
#endif
}
예제 #3
0
파일: main.c 프로젝트: supermk2/Deviation
int main() {
    PWR_Init();
    CLOCK_Init();
    UART_Initialize();
    if(PWR_CheckPowerSwitch()) PWR_Shutdown();
    dump_bootloader();
}
예제 #4
0
/*
**-----------------------------------------------------------------------------
**
**  Abstract:
**	This function initializes hardware setting.
**
**  Parameters:
**	None
**
**  Returns:
**	None
**
**-----------------------------------------------------------------------------
*/
UCHAR __low_level_init(void)
{
	VSWC = 0x13U;
	CLOCK_Init();	/* call Clock_Init function */
	systeminit();
	
	return MD_TRUE;
}
예제 #5
0
/*
**-----------------------------------------------------------------------------
**
**  Abstract:
**	This function initializes every macro.
**
**  Parameters:
**	None
**
**  Returns:
**	None
**
**-----------------------------------------------------------------------------
*/
void systeminit(void)
{
	CG_ReadResetSource();
	CLOCK_Init();
	TAU0_Init();
	WDT_Init();
	CRC0CTL = 0x00U;
	IAWCTL = 0x00U;
}
예제 #6
0
/*
**-----------------------------------------------------------------------------
**
**	Abstract:
**		This function  initializes every macro.
**
**	Parameters:
**		None
**
**	Returns:
**		None
**
**-----------------------------------------------------------------------------
*/
void SystemInit( void )
{
	WDTM = 0x77;	/* stops watch dog timer */
	/*Process of reset*/
	CG_ReadResetSource();
	/*Initialize the clock generator*/
	CLOCK_Init();
	/*Initialize the I/O ports*/
	PORT_Init();
	/*Initialize TM00 function*/
	TM00_Init();
}
예제 #7
0
int main() {
    PWR_Init();
    CLOCK_Init();
    UART_Initialize();
    if(PWR_CheckPowerSwitch()) PWR_Shutdown();
#if SPI_BOOTLOADER
    Initialize_ButtonMatrix();
    SPIFlash_Init(); //This must come before LCD_Init() for 7e
    SPI_FlashBlockWriteEnable(1); //Enable writing to all banks of SPIFlash
    LCD_Init();
    LCD_Clear(0x0000);
    BACKLIGHT_Init();
    BACKLIGHT_Brightness(5);
    LCD_SetFont(0);
    LCD_SetFontColor(0xffff);
    dump_bootloader(0);
#else
    dump_bootloader(1);
#endif
}
예제 #8
0
static portTASK_FUNCTION(AppTask, pvParameters) {
  (void)pvParameters; /* not used */
  RTC1_TTIME time;
  RTC1_TDATE date;

  if (RTC1_GetRTCTimeDate(&time, &date)==ERR_OK) {
    TmDt1_SetDate((uint16_t)date.year+2000, date.month, date.day);
    TmDt1_SetTime(time.hour, time.min, time.sec, 0);
  } else {
    for(;;) {} /* error */
  }
  (void)NEO_ClearAllPixel();
  (void)NEO_TransferPixels();

  CLOCK_Init();
  for(;;) {
    CLOCK_Update();
    FRTOS1_vTaskDelay(50/portTICK_RATE_MS);
  } /* for */
}
int main(void)
{
	CLOCK_Init();
	Initialize_GPIO();
	int i=0;
	GPIOE->ODR = 0;
//	GPIOE->ODR = 0xffff;
//	wait(400000);
	GPIOE->ODR = 0;
	/*for(i=0;i<5;i++)
			{
				GPIOA->ODR=0x0001;
				wait(1000000);
				GPIOA->ODR=0x0000;
				wait(1000000);
						//GPIOE->ODR = 0;
			}*/
	while(1)
	{

	}

}