rusefi/firmware/bootloader/bootloader_main.cpp

39 lines
649 B
C++
Raw Normal View History

2017-05-30 15:38:51 -07:00
#include "pch.h"
2023-12-26 12:31:31 -08:00
#include "usbconsole.h"
2017-05-30 15:38:51 -07:00
#include "hardware.h"
2023-12-26 12:31:31 -08:00
extern "C" {
#include "boot.h"
#include "shared_params.h"
}
2017-05-30 15:38:51 -07:00
int main(void) {
halInit();
chSysInit();
2023-08-25 22:34:36 -07:00
2023-12-26 12:31:31 -08:00
baseMCUInit();
// Init openblt shared params
SharedParamsInit();
// Init openblt itself
BootInit();
2017-05-30 15:38:51 -07:00
2023-08-25 22:34:36 -07:00
while (true) {
2023-12-26 12:31:31 -08:00
BootTask();
2023-08-25 22:34:36 -07:00
}
2017-05-30 15:38:51 -07:00
}
2023-12-26 12:31:31 -08:00
// very basic version, supports on chip pins only (really only used for USB)
void efiSetPadMode(const char* msg, brain_pin_e brainPin, iomode_t mode) {
ioportid_t port = getHwPort(msg, brainPin);
ioportmask_t pin = getHwPin(msg, brainPin);
/* paranoid */
if (port == GPIO_NULL) {
return;
}
palSetPadMode(port, pin, mode);
}