Timer(Timer)
Global variable
| Global variable | type | Annotation |
|---|---|---|
| battery_All | float | Cumulative battery electricity |
| battery_count | uint8_t | Battery count |
| battery_flag | uint8_t | Battery status logo |
| stop_time | u16 | Delay time |
| led_flag | u16 | Indicate whether to enter the flash state |
| led_twinkle_count | u16 | LED flash count |
| led_count | u16 | LED count |
| lower_power_flag | u8 | Low voltage sign |
| bulettohflag | u8 | Indicate whether Bluetooth data is sent |
Macro definition
| Macro definition | value | Annotation |
|---|---|---|
| RCC_APB1Periph_TIM6 | (Applicable platform timer clock) | Timer 6 clock |
method
TIM6_Init(void)
Initialize TIM6, set a time time 10 milliseconds
| Return value | type |
|---|---|
| none | void |
TIM7_Init(void)
Initialize TIM7
| Return value | type |
|---|---|
| none | void |
delay_time(u16 time)
Delayed specified time
| parameter | type | Annotation |
|---|---|---|
| time | u16 | Delay time, unit: 10ms |
| Return value | type |
|---|---|
| none | void |
my_delay(u16 s)
Delayed specified seconds
| parameter | type | Annotation |
|---|---|---|
| s | u16 | Time to delay, unit: second |
| Return value | type |
|---|---|
| none | void |
power_decect(void)
Voltage treatment
| Return value | type |
|---|---|
| none | void |
cotrol_led(void)
Control LED light status
| Return value | type |
|---|---|
| none | void |