1#include <main-header.h>
3static volatile uint32_t TimingDelay;
4static volatile long systickctr = 0;
5static volatile int delay_counter[5];
6extern uint32_t acm_byte_received;
7void reset_delay_counter(
int n) {
10int get_delay_counter(
int n) {
11 return delay_counter[n];
19void Delay(uint32_t nTime) {
22 while (TimingDelay != 0) {
33void TimingDelay_Decrement(
void) {
36 for (i = 0; i < 5; i++) {
39 if (TimingDelay != 0) {
48long get_systickctr() {
55long systick_diff(
long timestamp) {
56 long tc = get_systickctr();
59 return 0xFFFFFFFF - (timestamp - tc);
61 return tc - timestamp;
63void UserSysTick_Handler() {
65 if (acm_byte_received != 0) {
68 TimingDelay_Decrement();