You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
652 B
49 lines
652 B
#ifndef MAIN_H
|
|
#define MAIN_H
|
|
|
|
#ifdef RASPBERRY
|
|
#include "bsl/raspberry/bsl_raspberry.hpp"
|
|
#endif
|
|
|
|
#ifdef ARM_MCU
|
|
#include "bsl/nucleo_f042k6/bsl_nucleo_f042k6.hpp"
|
|
#endif
|
|
|
|
|
|
struct Delay
|
|
{
|
|
virtual void wait() = 0;
|
|
};
|
|
|
|
|
|
struct FreeRTOS_Delay : Delay
|
|
{
|
|
void wait() override
|
|
{
|
|
_wait();
|
|
}
|
|
private:
|
|
static void _wait()
|
|
{
|
|
for(volatile int i = 0; i < 10; i++);
|
|
}
|
|
};
|
|
|
|
struct STM_Hal_Delay : Delay
|
|
{
|
|
void wait() override
|
|
{
|
|
_wait();
|
|
}
|
|
private:
|
|
static void _wait()
|
|
{
|
|
// systick stuff here
|
|
for(volatile int i = 0; i < 1000; i++);
|
|
}
|
|
};
|
|
|
|
|
|
|
|
#endif /* MAIN_H */
|