This commit is contained in:
Rene Hopf
2017-09-12 23:17:53 +02:00
parent 18b3505cd7
commit 75558e4cde
2 changed files with 4 additions and 0 deletions

View File

@@ -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

View File

@@ -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);