Skip to content

Commit

Permalink
switch panda to use not gmlan for started detection
Browse files Browse the repository at this point in the history
  • Loading branch information
geohot committed Aug 28, 2017
1 parent 22a00b1 commit 1e48d08
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.9.4
v0.9.5
16 changes: 4 additions & 12 deletions board/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,30 +79,22 @@ int get_health_pkt(void *dat) {
uint8_t started_signal_detected;
uint8_t started_alt;
} *health = dat;
#ifdef PANDA
int started_signal = (GPIOB->IDR & (1 << 12)) == 0;
#else
int started_signal = (GPIOC->IDR & (1 << 13)) != 0;
#endif

health->voltage = adc_get(ADCCHAN_VOLTAGE);

#ifdef PANDA
health->current = adc_get(ADCCHAN_CURRENT);
health->started = (GPIOA->IDR & (1 << 1)) == 0;
#else
health->current = 0;
#endif
health->started = started_signal;

#ifdef PANDA
health->started_alt = (GPIOA->IDR & (1 << 1)) == 0;
#else
health->started_alt = 0;
health->started = (GPIOC->IDR & (1 << 13)) != 0;
#endif

health->controls_allowed = controls_allowed;
health->gas_interceptor_detected = gas_interceptor_detected;

// DEPRECATED
health->started_alt = 0;
health->started_signal_detected = 0;

return sizeof(*health);
Expand Down

0 comments on commit 1e48d08

Please sign in to comment.