mirror of
https://github.com/rene-dev/stmbl.git
synced 2026-02-05 09:51:47 +08:00
uvw led
This commit is contained in:
@@ -8,4 +8,5 @@ fb_switch0.com_abs_pos = rev2.out
|
||||
fb_switch0.com_state = 3
|
||||
fb_switch0.com_polecount = conf0.com_fb_polecount
|
||||
io0.fb1g = 1
|
||||
io0.fb1y = uvw0.led
|
||||
conf0.com_fb_polecount = conf0.polecount
|
||||
|
||||
@@ -11,6 +11,8 @@ HAL_PIN(u);
|
||||
HAL_PIN(v);
|
||||
HAL_PIN(w);
|
||||
|
||||
HAL_PIN(led);
|
||||
|
||||
HAL_PIN(p0);
|
||||
HAL_PIN(p1);
|
||||
HAL_PIN(p2);
|
||||
@@ -43,6 +45,7 @@ static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_
|
||||
struct uvw_pin_ctx_t *pins = (struct uvw_pin_ctx_t *)pin_ptr;
|
||||
|
||||
uint32_t rpos = (PIN(u) > 0.0) * 1.0 + (PIN(v) > 0.0) * 2.0 + (PIN(w) > 0.0) * 4.0;
|
||||
PIN(led) = (PIN(u) > 0.0) ^ (PIN(v) > 0.0) ^ (PIN(w) > 0.0);
|
||||
//TODO: make this const, fault output
|
||||
uint32_t t[8];
|
||||
t[0] = PIN(p0);
|
||||
|
||||
Reference in New Issue
Block a user