Nýjir kóðar og uppfærðir gamlir kóðar fyrir arduino yfir í zephyr

This commit is contained in:
2026-10-08 15:18:32 +00:00
parent 53091f68df
commit c2d8780478
24 changed files with 922 additions and 338 deletions
+24 -2
View File
@@ -1,9 +1,31 @@
#ifndef TIMER_USEC_H
#define TIMER_USEC_H
#include <avr/io.h>
struct Timer_usec {
//#include <avr/io.h>
#include <stdint.h>
#include <zephyr/kernel.h>
// struct Timer_usec {
// Timer_usec();
// void init(uint16_t period_us);
//};
class Timer_usec {
public:
using callback_t = void (*)(void *context);
Timer_usec();
void set_callback(callback_t callback, void *context);
void init(uint16_t period_us);
private:
struct k_timer timer;
callback_t callback;
void *callback_context;
static void expiry_handler(struct k_timer *timer);
};
#endif