tle8888 reinit command

This commit is contained in:
rusefi 2019-09-05 10:30:27 -04:00
parent e4566ba6aa
commit 5d8e1f6c73
8 changed files with 36 additions and 7 deletions

View File

@ -37,11 +37,18 @@
#include "idle_thread.h" #include "idle_thread.h"
#include "periodic_thread_controller.h" #include "periodic_thread_controller.h"
#include "tps.h" #include "tps.h"
#if EFI_PROD_CODE #if EFI_PROD_CODE
#include "rusefi.h" #include "rusefi.h"
#include "mpu_util.h" #include "mpu_util.h"
#endif /* EFI_PROD_CODE */ #endif /* EFI_PROD_CODE */
#if (BOARD_TLE8888_COUNT > 0)
#include "gpio/tle8888.h"
#endif
EXTERN_ENGINE EXTERN_ENGINE
; ;
@ -261,12 +268,19 @@ static void handleCommandX14(uint16_t index) {
case 3: case 3:
grabTPSIsWideOpen(); grabTPSIsWideOpen();
return; return;
case 4: // case 4: tps2_closed
// case 5: tps2_wot
case 6:
grabPedalIsUp(); grabPedalIsUp();
return; return;
case 5: case 7:
grabPedalIsWideOpen(); grabPedalIsWideOpen();
return; return;
case 8:
#if (BOARD_TLE8888_COUNT > 0)
requestTLE8888initialization();
#endif
return;
} }

View File

@ -373,7 +373,7 @@ static THD_FUNCTION(tle8888_driver_thread, p) {
/* set state to TLE8888_FAILED or force reinit? */ /* set state to TLE8888_FAILED or force reinit? */
} }
/* if bit OE is cleared - reset happend */ /* if bit OE is cleared - reset happened */
if (!(chip->OpStat[1] & (1 << 6))) { if (!(chip->OpStat[1] & (1 << 6))) {
needInitialSpi = true; needInitialSpi = true;
} }
@ -381,6 +381,10 @@ static THD_FUNCTION(tle8888_driver_thread, p) {
} }
} }
void requestTLE8888initialization(void) {
needInitialSpi = true;
}
/*==========================================================================*/ /*==========================================================================*/
/* Driver interrupt handlers. */ /* Driver interrupt handlers. */
/*==========================================================================*/ /*==========================================================================*/

View File

@ -51,6 +51,7 @@ extern "C"
* @return return gpio chip base * @return return gpio chip base
*/ */
int tle8888_add(unsigned int index, const struct tle8888_config *cfg); int tle8888_add(unsigned int index, const struct tle8888_config *cfg);
void requestTLE8888initialization(void);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -82,7 +82,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code ; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START ; CONFIG_DEFINITION_START
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Wed Sep 04 00:19:03 EDT 2019 ; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Thu Sep 05 10:29:45 EDT 2019
pageSize = 20000 pageSize = 20000
page = 1 page = 1
@ -2282,6 +2282,7 @@ cmd_calibrate_tps_2_closed = "w\x00\x14\x00\x04"
cmd_calibrate_tps_2_wot = "w\x00\x14\x00\x05" cmd_calibrate_tps_2_wot = "w\x00\x14\x00\x05"
cmd_calibrate_pedal_up = "w\x00\x14\x00\x06" cmd_calibrate_pedal_up = "w\x00\x14\x00\x06"
cmd_calibrate_pedal_down = "w\x00\x14\x00\x07" cmd_calibrate_pedal_down = "w\x00\x14\x00\x07"
cmd_tle8888_init = "w\x00\x14\x00\x08"
cmd_test_radiator_fan = "w\x00\x15\x00\x01" cmd_test_radiator_fan = "w\x00\x15\x00\x01"
cmd_test_check_engine_light = "w\x00\x16\x00\x01" cmd_test_check_engine_light = "w\x00\x16\x00\x01"
@ -3163,6 +3164,7 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00"
field = "TLE8888 Chip Select", tle8888_cs field = "TLE8888 Chip Select", tle8888_cs
field = "TLE8888 SPI", tle8888spiDevice field = "TLE8888 SPI", tle8888spiDevice
field = "useTLE8888_hall_mode", useTLE8888_hall_mode field = "useTLE8888_hall_mode", useTLE8888_hall_mode
commandButton = "Reinit", cmd_tle8888_init
dialog = connection, "", yAxis dialog = connection, "", yAxis
field = "STM32 vRef voltage", adcVcc field = "STM32 vRef voltage", adcVcc

View File

@ -1302,6 +1302,7 @@ cmd_calibrate_tps_2_closed = "w\x00\x14\x00\x04"
cmd_calibrate_tps_2_wot = "w\x00\x14\x00\x05" cmd_calibrate_tps_2_wot = "w\x00\x14\x00\x05"
cmd_calibrate_pedal_up = "w\x00\x14\x00\x06" cmd_calibrate_pedal_up = "w\x00\x14\x00\x06"
cmd_calibrate_pedal_down = "w\x00\x14\x00\x07" cmd_calibrate_pedal_down = "w\x00\x14\x00\x07"
cmd_tle8888_init = "w\x00\x14\x00\x08"
cmd_test_radiator_fan = "w\x00\x15\x00\x01" cmd_test_radiator_fan = "w\x00\x15\x00\x01"
cmd_test_check_engine_light = "w\x00\x16\x00\x01" cmd_test_check_engine_light = "w\x00\x16\x00\x01"
@ -2183,6 +2184,7 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00"
field = "TLE8888 Chip Select", tle8888_cs field = "TLE8888 Chip Select", tle8888_cs
field = "TLE8888 SPI", tle8888spiDevice field = "TLE8888 SPI", tle8888spiDevice
field = "useTLE8888_hall_mode", useTLE8888_hall_mode field = "useTLE8888_hall_mode", useTLE8888_hall_mode
commandButton = "Reinit", cmd_tle8888_init
dialog = connection, "", yAxis dialog = connection, "", yAxis
field = "STM32 vRef voltage", adcVcc field = "STM32 vRef voltage", adcVcc

View File

@ -82,7 +82,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code ; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START ; CONFIG_DEFINITION_START
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Wed Sep 04 00:19:08 EDT 2019 ; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Thu Sep 05 10:29:50 EDT 2019
pageSize = 20000 pageSize = 20000
page = 1 page = 1
@ -2282,6 +2282,7 @@ cmd_calibrate_tps_2_closed = "w\x00\x14\x00\x04"
cmd_calibrate_tps_2_wot = "w\x00\x14\x00\x05" cmd_calibrate_tps_2_wot = "w\x00\x14\x00\x05"
cmd_calibrate_pedal_up = "w\x00\x14\x00\x06" cmd_calibrate_pedal_up = "w\x00\x14\x00\x06"
cmd_calibrate_pedal_down = "w\x00\x14\x00\x07" cmd_calibrate_pedal_down = "w\x00\x14\x00\x07"
cmd_tle8888_init = "w\x00\x14\x00\x08"
cmd_test_radiator_fan = "w\x00\x15\x00\x01" cmd_test_radiator_fan = "w\x00\x15\x00\x01"
cmd_test_check_engine_light = "w\x00\x16\x00\x01" cmd_test_check_engine_light = "w\x00\x16\x00\x01"
@ -3163,6 +3164,7 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00"
field = "TLE8888 Chip Select", tle8888_cs field = "TLE8888 Chip Select", tle8888_cs
field = "TLE8888 SPI", tle8888spiDevice field = "TLE8888 SPI", tle8888spiDevice
field = "useTLE8888_hall_mode", useTLE8888_hall_mode field = "useTLE8888_hall_mode", useTLE8888_hall_mode
commandButton = "Reinit", cmd_tle8888_init
dialog = connection, "", yAxis dialog = connection, "", yAxis
field = "STM32 vRef voltage", adcVcc field = "STM32 vRef voltage", adcVcc

View File

@ -82,7 +82,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code ; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START ; CONFIG_DEFINITION_START
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Wed Sep 04 00:19:06 EDT 2019 ; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Thu Sep 05 10:29:47 EDT 2019
pageSize = 20000 pageSize = 20000
page = 1 page = 1
@ -2275,6 +2275,7 @@ cmd_calibrate_tps_2_closed = "w\x00\x14\x00\x04"
cmd_calibrate_tps_2_wot = "w\x00\x14\x00\x05" cmd_calibrate_tps_2_wot = "w\x00\x14\x00\x05"
cmd_calibrate_pedal_up = "w\x00\x14\x00\x06" cmd_calibrate_pedal_up = "w\x00\x14\x00\x06"
cmd_calibrate_pedal_down = "w\x00\x14\x00\x07" cmd_calibrate_pedal_down = "w\x00\x14\x00\x07"
cmd_tle8888_init = "w\x00\x14\x00\x08"
cmd_test_radiator_fan = "w\x00\x15\x00\x01" cmd_test_radiator_fan = "w\x00\x15\x00\x01"
cmd_test_check_engine_light = "w\x00\x16\x00\x01" cmd_test_check_engine_light = "w\x00\x16\x00\x01"
@ -3148,6 +3149,7 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00"
field = "TLE8888 Chip Select", tle8888_cs field = "TLE8888 Chip Select", tle8888_cs
field = "TLE8888 SPI", tle8888spiDevice field = "TLE8888 SPI", tle8888spiDevice
field = "useTLE8888_hall_mode", useTLE8888_hall_mode field = "useTLE8888_hall_mode", useTLE8888_hall_mode
commandButton = "Reinit", cmd_tle8888_init
dialog = connection, "", yAxis dialog = connection, "", yAxis
field = "STM32 vRef voltage", adcVcc field = "STM32 vRef voltage", adcVcc

View File

@ -82,7 +82,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code ; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START ; CONFIG_DEFINITION_START
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Wed Sep 04 00:19:11 EDT 2019 ; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Thu Sep 05 10:29:52 EDT 2019
pageSize = 20000 pageSize = 20000
page = 1 page = 1
@ -2278,6 +2278,7 @@ cmd_calibrate_tps_2_closed = "w\x00\x14\x00\x04"
cmd_calibrate_tps_2_wot = "w\x00\x14\x00\x05" cmd_calibrate_tps_2_wot = "w\x00\x14\x00\x05"
cmd_calibrate_pedal_up = "w\x00\x14\x00\x06" cmd_calibrate_pedal_up = "w\x00\x14\x00\x06"
cmd_calibrate_pedal_down = "w\x00\x14\x00\x07" cmd_calibrate_pedal_down = "w\x00\x14\x00\x07"
cmd_tle8888_init = "w\x00\x14\x00\x08"
cmd_test_radiator_fan = "w\x00\x15\x00\x01" cmd_test_radiator_fan = "w\x00\x15\x00\x01"
cmd_test_check_engine_light = "w\x00\x16\x00\x01" cmd_test_check_engine_light = "w\x00\x16\x00\x01"
@ -3159,6 +3160,7 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00"
field = "TLE8888 Chip Select", tle8888_cs field = "TLE8888 Chip Select", tle8888_cs
field = "TLE8888 SPI", tle8888spiDevice field = "TLE8888 SPI", tle8888spiDevice
field = "useTLE8888_hall_mode", useTLE8888_hall_mode field = "useTLE8888_hall_mode", useTLE8888_hall_mode
commandButton = "Reinit", cmd_tle8888_init
dialog = connection, "", yAxis dialog = connection, "", yAxis
field = "STM32 vRef voltage", adcVcc field = "STM32 vRef voltage", adcVcc