Skip to content

Commit

Permalink
Fix board detection on white
Browse files Browse the repository at this point in the history
  • Loading branch information
robbederks committed Nov 6, 2019
1 parent 0e72c18 commit e90897a
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions board/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,8 @@ void detect_board_type(void) {
#ifdef PANDA
// SPI lines floating: white (TODO: is this reliable?)
if((detect_with_pull(GPIOA, 4, PULL_DOWN)) || (detect_with_pull(GPIOA, 5, PULL_DOWN)) || (detect_with_pull(GPIOA, 6, PULL_DOWN)) || (detect_with_pull(GPIOA, 7, PULL_DOWN))){
// white panda has serial lines, if floating, it's a dos
if (!detect_with_pull(GPIOA, 2, PULL_DOWN) && !detect_with_pull(GPIOA, 3, PULL_DOWN)) {
// TODO: replace with DOS
hw_type = HW_TYPE_UNO;
current_board = &board_uno;
} else {
hw_type = HW_TYPE_WHITE_PANDA;
current_board = &board_white;
}
hw_type = HW_TYPE_WHITE_PANDA;
current_board = &board_white;
} else if(detect_with_pull(GPIOA, 13, PULL_DOWN)) { // Rev AB deprecated, so no pullup means black. In REV C, A13 is pulled up to 5V with a 10K
hw_type = HW_TYPE_GREY_PANDA;
current_board = &board_grey;
Expand Down

0 comments on commit e90897a

Please sign in to comment.