USB and TLE8888 not working for F4 or F767 #764

This commit is contained in:
rusefi 2019-04-19 12:42:21 -04:00
parent f7ea6c8cbe
commit 54b2f311fe
4 changed files with 27 additions and 5 deletions

View File

@ -180,6 +180,15 @@ static void lcdInfo(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
scheduleMsg(logger, "HD44780 D7=%s", hwPortname(CONFIGB(HD44780_db7)));
}
void stopHD44780_pins() {
unregisterPin(engineConfiguration->bc.HD44780_rs, activeConfiguration.bc.HD44780_rs);
unregisterPin(engineConfiguration->bc.HD44780_e, activeConfiguration.bc.HD44780_e);
unregisterPin(engineConfiguration->bc.HD44780_db4, activeConfiguration.bc.HD44780_db4);
unregisterPin(engineConfiguration->bc.HD44780_db5, activeConfiguration.bc.HD44780_db5);
unregisterPin(engineConfiguration->bc.HD44780_db6, activeConfiguration.bc.HD44780_db6);
unregisterPin(engineConfiguration->bc.HD44780_db7, activeConfiguration.bc.HD44780_db7);
}
void lcd_HD44780_init(Logging *sharedLogger) {
logger = sharedLogger;

View File

@ -13,6 +13,7 @@ extern "C"
{
#endif /* __cplusplus */
void stopHD44780_pins();
void lcd_HD44780_init(Logging *sharedLogger);
void lcd_HD44780_set_position(uint8_t row, uint8_t column);
void lcd_HD44780_print_char(char data);

View File

@ -98,6 +98,20 @@ static bool isJoystickEnabled() {
CONFIGB(joystickDPin) != GPIO_UNASSIGNED;
}
void stopJoystickPins() {
brain_pin_markUnused(CONFIGB(joystickCenterPin));
brain_pin_markUnused(CONFIGB(joystickAPin));
brain_pin_markUnused(CONFIGB(joystickDPin));
}
void startJoystickPins() {
efiSetPadMode("joy center", CONFIGB(joystickCenterPin), PAL_MODE_INPUT_PULLUP);
efiSetPadMode("joy A", CONFIGB(joystickAPin), PAL_MODE_INPUT_PULLUP);
// not used so far efiSetPadMode("joy B", CONFIGB(joystickBPin), PAL_MODE_INPUT_PULLUP);
// not used so far efiSetPadMode("joy C", CONFIGB(joystickCPin), PAL_MODE_INPUT_PULLUP);
efiSetPadMode("joy D", CONFIGB(joystickDPin), PAL_MODE_INPUT_PULLUP);
}
void initJoystick(Logging *shared) {
addConsoleAction("joystickinfo", joystickInfo);
if (!isJoystickEnabled())
@ -110,11 +124,7 @@ void initJoystick(Logging *shared) {
// not used so far applyPin(CONFIGB(joystickCPin));
enableExti(CONFIGB(joystickDPin), PAL_EVENT_MODE_RISING_EDGE, (palcallback_t)(void *)extCallback);
efiSetPadMode("joy center", CONFIGB(joystickCenterPin), PAL_MODE_INPUT_PULLUP);
efiSetPadMode("joy A", CONFIGB(joystickAPin), PAL_MODE_INPUT_PULLUP);
// not used so far efiSetPadMode("joy B", CONFIGB(joystickBPin), PAL_MODE_INPUT_PULLUP);
// not used so far efiSetPadMode("joy C", CONFIGB(joystickCPin), PAL_MODE_INPUT_PULLUP);
efiSetPadMode("joy D", CONFIGB(joystickDPin), PAL_MODE_INPUT_PULLUP);
startJoystickPins();
}
#endif /* HAL_USE_PAL && EFI_JOYSTICK */

View File

@ -19,5 +19,7 @@ typedef enum {
void onJoystick(joystick_button_e button);
void initJoystick(Logging *shared);
void startJoystickPins();
void stopJoystickPins();
#endif /* CONTROLLERS_JOYSTICK_H_ */