tflite_micro_person_detection_init

This commit is contained in:
yangqingsheng
2020-12-08 17:16:20 +08:00
parent 55168d954d
commit 200c0ff460
310 changed files with 121982 additions and 208 deletions

View File

@@ -0,0 +1,82 @@
#include "delay.h"
#include "sys.h"
#ifdef __cplusplus
extern "C" {
#endif
void delay_us(uint32_t time_us) {
uint32_t clk = 80; // CPU 80MHz
uint32_t ticks = time_us * clk; // time is us
uint32_t told = SysTick->VAL;
uint32_t tnow = told;
uint32_t tcnt = 0;
for(; tcnt<ticks; tnow=SysTick->VAL)
{
if(tnow != told) {
if(tnow < told) {
tcnt += told - tnow;
} else {
tcnt += SysTick->LOAD-tnow + told;
} told = tnow;
}
}
}
void delay_ms(uint32_t time_ms) {
uint32_t clk = 80; // CPU 80MHz
uint32_t ticks = time_ms * clk * 1000; // time is ms
uint32_t told = SysTick->VAL;
uint32_t tnow = told;
uint32_t tcnt = 0;
for(; tcnt<ticks; tnow=SysTick->VAL)
{
if(tnow != told) {
if(tnow < told) {
tcnt += told - tnow;
} else {
tcnt += SysTick->LOAD-tnow + told;
} told = tnow;
}
}
}
#ifdef __cplusplus
}
#endif