mirror of https://github.com/rusefi/rusefi.git
don't use standard sprintf/snprintf (#1174)
This commit is contained in:
parent
e32be1799d
commit
c1319342d5
|
@ -11,6 +11,7 @@
|
|||
#include "io_pins.h"
|
||||
|
||||
#if EFI_PROD_CODE
|
||||
#include "os_access.h"
|
||||
#include "efi_gpio.h"
|
||||
#include "drivers/gpio/gpio_ext.h"
|
||||
|
||||
|
@ -102,10 +103,11 @@ iomode_t getInputMode(pin_input_mode_e mode) {
|
|||
}
|
||||
|
||||
#if HAL_USE_ICU
|
||||
static char icuError[30];
|
||||
|
||||
void efiIcuStart(const char *msg, ICUDriver *icup, const ICUConfig *config) {
|
||||
if (icup->state != ICU_STOP && icup->state != ICU_READY) {
|
||||
static char icuError[30];
|
||||
sprintf(icuError, "ICU already used %s", msg);
|
||||
chsnprintf(icuError, sizeof(icuError), "ICU already used %s", msg);
|
||||
firmwareError(CUSTOM_ERR_6679, icuError);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -101,16 +101,16 @@ static void reportPins(void) {
|
|||
|
||||
/* use autogeneraged helpers here? */
|
||||
if (pin_diag == PIN_OK) {
|
||||
snprintf(pin_error, sizeof(pin_error), "Ok");
|
||||
chsnprintf(pin_error, sizeof(pin_error), "Ok");
|
||||
} else if (pin_diag != PIN_INVALID) {
|
||||
snprintf(pin_error, sizeof(pin_error), "%s%s%s%s%s",
|
||||
chsnprintf(pin_error, sizeof(pin_error), "%s%s%s%s%s",
|
||||
pin_diag & PIN_OPEN ? "open_load " : "",
|
||||
pin_diag & PIN_SHORT_TO_GND ? "short_to_gnd " : "",
|
||||
pin_diag & PIN_SHORT_TO_BAT ? "short_to_bat " : "",
|
||||
pin_diag & PIN_OVERLOAD ? "overload " : "",
|
||||
pin_diag & PIN_DRIVER_OVERTEMP ? "overtemp": "");
|
||||
} else {
|
||||
snprintf(pin_error, sizeof(pin_error), "INVALID");
|
||||
chsnprintf(pin_error, sizeof(pin_error), "INVALID");
|
||||
}
|
||||
|
||||
/* here show all pins, unused too */
|
||||
|
|
Loading…
Reference in New Issue