'pins' fix

This commit is contained in:
rusefi 2019-04-13 10:59:29 -04:00
parent db9456902f
commit 1e422f48f2
2 changed files with 9 additions and 7 deletions

View File

@ -112,9 +112,7 @@ static int getPortIndex(ioportid_t port) {
} }
static void reportPins(void) { static void reportPins(void) {
unsigned int i; for (unsigned int i = 0; i < PIN_REPO_SIZE; i++) {
for (i = 0; i < PIN_REPO_SIZE; i++) {
const char *pin_user = PIN_USED[i]; const char *pin_user = PIN_USED[i];
/* show used pins */ /* show used pins */
@ -123,12 +121,12 @@ static void reportPins(void) {
int pin = i % PORT_SIZE; int pin = i % PORT_SIZE;
ioportid_t port = ports[portIndex]; ioportid_t port = ports[portIndex];
scheduleMsg(&logger, "pin %s%d: %s\n", portname(port), pin, pin_user); scheduleMsg(&logger, "pin %s%d: %s", portname(port), pin, pin_user);
} }
} }
#if (BOARD_EXT_GPIOCHIPS > 0) #if (BOARD_EXT_GPIOCHIPS > 0)
for (i = PIN_REPO_SIZE ; i < PIN_REPO_SIZE + BOARD_EXT_PINREPOPINS /* gpiochips_get_total_pins()*/ ; i++) { for (unsigned int i = PIN_REPO_SIZE ; i < PIN_REPO_SIZE + BOARD_EXT_PINREPOPINS /* gpiochips_get_total_pins()*/ ; i++) {
const char *pin_name; const char *pin_name;
const char *pin_user; const char *pin_user;
brain_pin_e brainPin = index_to_brainPin(i); brain_pin_e brainPin = index_to_brainPin(i);
@ -138,10 +136,10 @@ static void reportPins(void) {
/* here show all pins, unused too */ /* here show all pins, unused too */
if (pin_name != NULL) { if (pin_name != NULL) {
scheduleMsg(&logger, "ext %s: %s\n", scheduleMsg(&logger, "ext %s: %s",
pin_name, pin_user ? pin_user : "free"); pin_name, pin_user ? pin_user : "free");
} else { } else {
scheduleMsg(&logger, "ext %s.%d: %s\n", scheduleMsg(&logger, "ext %s.%d: %s",
gpiochips_getChipName(brainPin), gpiochips_getPinOffset(brainPin), pin_user ? pin_user : "free"); gpiochips_getChipName(brainPin), gpiochips_getPinOffset(brainPin), pin_user ? pin_user : "free");
} }
} }

View File

@ -121,6 +121,10 @@ void initLoggingCentral(void) {
* in order to reduce memory usage * in order to reduce memory usage
*/ */
void scheduleMsg(Logging *logging, const char *fmt, ...) { void scheduleMsg(Logging *logging, const char *fmt, ...) {
for (unsigned int i = 0;i<strlen(fmt);i++) {
// todo: open question which layer would not handle CR/LF propertly?
efiAssertVoid(OBD_PCM_Processor_Fault, fmt[i] != '\n', "No CRLF please");
}
#if EFI_TEXT_LOGGING #if EFI_TEXT_LOGGING
if (logging == NULL) { if (logging == NULL) {
warning(CUSTOM_ERR_LOGGING_NULL, "logging NULL"); warning(CUSTOM_ERR_LOGGING_NULL, "logging NULL");