Пример #1
0
int main(void)
{
    // init sys
    SystemInit();

    // init peripheral
    UART_Configuration();
    delay_init();   
    KEY_GPIO_Init();
    TIM3_Int_Init(100,7199);
    Motor_Init();
    RGB_LED_Init();
    DHT11_Init();
    IR_Init();

    // init vars
    GenProtocolInit();
    BuzProtocolInit();
    UartInit();

    while(1)
    {
        // handle uart msg
        HandleMsg();
        
        // handle key events
        HandleKey();        

        // business logic tick 
        BuzTick();  
    }
}
Пример #2
0
void Hal_Init(void)
{
	RGB_LED_Init();
	printf("RGB LED Init OK\r\n");
	LED_GPIO_Init();
	printf("LED Init OK\r\n");
	TIM3_Int_Init(7199,9);   //1ms SystemTimeCount + 1
	printf("SystemTime Init OK\r\n");
	KEY_GPIO_Init();
	printf("KEY Init OK\r\n");
	Motor_Init();
	printf("Motor Init OK\r\n");
	Delay_Init(72);
	DHT11_Init();
	printf("DHT11 Init OK\r\n");
	IR_Init();
	printf("IR Init OK\r\n");
	OLED_Init();
	OLED_ShowString(40, 0, "GoKit");
	OLED_ShowString(0, 32, "www.gizwits.com");	
	
	
}