2022-12-01 06:15:09 +08:00
|
|
|
// minimal code to fake a panda for tests
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "utils.h"
|
|
|
|
|
|
|
|
#define CANFD
|
|
|
|
#define ALLOW_DEBUG
|
|
|
|
#define PANDA
|
|
|
|
|
2022-12-01 14:12:28 +08:00
|
|
|
#define ENTER_CRITICAL() 0
|
|
|
|
#define EXIT_CRITICAL() 0
|
|
|
|
|
2022-12-01 06:15:09 +08:00
|
|
|
void print(const char *a) {
|
2022-12-01 14:12:28 +08:00
|
|
|
printf("%s", a);
|
2022-12-01 06:15:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void puth(unsigned int i) {
|
|
|
|
printf("%u", i);
|
|
|
|
}
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
uint32_t CNT;
|
|
|
|
} TIM_TypeDef;
|
|
|
|
|
|
|
|
TIM_TypeDef timer;
|
|
|
|
TIM_TypeDef *MICROSECOND_TIMER = &timer;
|
|
|
|
uint32_t microsecond_timer_get(void);
|
|
|
|
|
|
|
|
uint32_t microsecond_timer_get(void) {
|
|
|
|
return MICROSECOND_TIMER->CNT;
|
|
|
|
}
|