2019-07-23 15:07:06 -07:00
|
|
|
// ///////////////////////////////////////////////////////////// //
|
|
|
|
|
// Hardware abstraction layer for all different supported boards //
|
|
|
|
|
// ///////////////////////////////////////////////////////////// //
|
2025-07-19 21:58:58 -07:00
|
|
|
#include "board/boards/board_declarations.h"
|
|
|
|
|
#include "board/boards/unused_funcs.h"
|
2019-07-23 15:07:06 -07:00
|
|
|
|
|
|
|
|
// ///// Board definition and detection ///// //
|
2025-07-19 21:58:58 -07:00
|
|
|
#include "board/stm32f4/lladc.h"
|
|
|
|
|
#include "board/drivers/harness.h"
|
|
|
|
|
#include "board/drivers/fan.h"
|
|
|
|
|
#include "board/stm32f4/llfan.h"
|
|
|
|
|
#include "board/drivers/clock_source.h"
|
|
|
|
|
#include "board/boards/dos.h"
|
2019-07-23 15:07:06 -07:00
|
|
|
|
|
|
|
|
void detect_board_type(void) {
|
2024-02-16 22:58:01 -08:00
|
|
|
set_gpio_output(GPIOC, 14, 1);
|
|
|
|
|
set_gpio_output(GPIOC, 5, 1);
|
2025-07-19 21:05:12 -07:00
|
|
|
if (!detect_with_pull(GPIOB, 1, PULL_UP) && !detect_with_pull(GPIOB, 7, PULL_UP)) {
|
2024-02-16 22:58:01 -08:00
|
|
|
hw_type = HW_TYPE_DOS;
|
|
|
|
|
current_board = &board_dos;
|
|
|
|
|
}
|
2025-03-12 17:26:07 +01:00
|
|
|
|
|
|
|
|
// Return A13 to the alt mode to fix SWD
|
|
|
|
|
set_gpio_alternate(GPIOA, 13, GPIO_AF0_SWJ);
|
2019-07-23 15:07:06 -07:00
|
|
|
}
|