STM32 V5 source code
guowenxue
2018-05-16 8a8715e9d87d63c5908f8e00d1b5fe3595e41c41
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/****************************************************************************
*   Copyright: (C)2018 Î人ÁèÔÆÎïÍøÖÇ¿ÆÊµÑéÊÒ www.iot-yun.com
*      Author: GuoWenxue<guowenxue@gmail.com> QQ: 281143292
* Description: ·Ü¶·STM32v5¿ª·¢°å ´®¿ÚʹÓóÌÐò
*   ChangeLog:
*        °æ±¾ºÅ     ÈÕÆÚ       ×÷Õß      ËµÃ÷
*        V1.0.0  2018.05.11  GuoWenxue   ·¢²¼¸Ã°æ±¾
****************************************************************************/
 
#include <stdio.h>
#include "stm32f10x.h"
#include "stm32v5_led.h"
#include "stm32v5_usart.h"
#include "stm32v5_systick.h"
 
int main(void)
{
    uint32_t       start_time;
    
    init_led_gpio();
    init_dbg_uart(USART_PORT1, 115200);
    init_systick();
    
    printf("Systick programe start running\n\n");
 
    while(1)
    {
        turn_led(LED1, ON);
        
        start_time = jiffies;
        while( time_before(jiffies, start_time+10) )
            printf("*");
    
        turn_led(LED1, OFF);
        printf("\njiffies[ %010u ==> ", jiffies);
        msleep(1000);
        printf("%010u ]\n\n", jiffies);
    }
}