2020-09-23 18:59:59 +00:00
|
|
|
#include "hal_test_comp.h"
|
2017-06-03 01:52:22 +00:00
|
|
|
#include "hal.h"
|
|
|
|
|
|
|
|
HAL_COMP(hal_test);
|
|
|
|
|
|
|
|
HAL_PIN(rt_wait);
|
|
|
|
HAL_PIN(frt_wait);
|
|
|
|
|
2019-04-29 20:08:54 +00:00
|
|
|
static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) {
|
2017-09-06 02:20:06 +00:00
|
|
|
// struct rev_ctx_t * ctx = (struct rev_ctx_t *)ctx_ptr;
|
|
|
|
struct hal_test_pin_ctx_t *pins = (struct hal_test_pin_ctx_t *)pin_ptr;
|
2017-06-03 01:52:22 +00:00
|
|
|
|
2017-09-06 02:20:06 +00:00
|
|
|
volatile uint32_t foo = 0;
|
|
|
|
(void)foo;
|
|
|
|
for(uint32_t i = 0; i < PIN(rt_wait); i++) {
|
|
|
|
foo = 1;
|
|
|
|
}
|
2017-06-03 01:52:22 +00:00
|
|
|
}
|
|
|
|
|
2019-04-29 20:08:54 +00:00
|
|
|
static void frt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) {
|
2017-09-06 02:20:06 +00:00
|
|
|
// struct rev_ctx_t * ctx = (struct rev_ctx_t *)ctx_ptr;
|
|
|
|
struct hal_test_pin_ctx_t *pins = (struct hal_test_pin_ctx_t *)pin_ptr;
|
2017-06-03 01:52:22 +00:00
|
|
|
|
2017-09-06 02:20:06 +00:00
|
|
|
volatile uint32_t foo = 0;
|
|
|
|
(void)foo;
|
|
|
|
for(uint32_t i = 0; i < PIN(frt_wait); i++) {
|
|
|
|
foo = 1;
|
|
|
|
}
|
2017-06-03 01:52:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
hal_comp_t hal_test_comp_struct = {
|
2017-09-06 02:20:06 +00:00
|
|
|
.name = "hal_test",
|
|
|
|
.nrt = 0,
|
|
|
|
.rt = rt_func,
|
|
|
|
.frt = frt_func,
|
|
|
|
.nrt_init = 0,
|
|
|
|
.rt_start = 0,
|
|
|
|
.frt_start = 0,
|
|
|
|
.rt_stop = 0,
|
|
|
|
.frt_stop = 0,
|
|
|
|
.ctx_size = 0,
|
|
|
|
.pin_count = sizeof(struct hal_test_pin_ctx_t) / sizeof(struct hal_pin_inst_t),
|
2017-06-03 01:52:22 +00:00
|
|
|
};
|