Esempio n. 1
0
static void restart_after_loss() {
  lost = false;
  can_load = false;
  s_timer = NULL;
  for (int i=0; i<10; i++) {
    for (int j=0; j<20; j++) {
      grid[i][j] = false;
      grid_col[i][j] = 255;
    }
  }
  blockType = -1;
  nextBlockType = -1;
  load_choice = 0;
  Layer *window_layer = window_get_root_layer(window);
  layer_add_child(window_layer, text_layer_get_layer(title_layer));
  text_layer_set_text(title_layer, "Tetris");
  layer_add_child(window_layer, text_layer_get_layer(new_game_label_layer));
  layer_add_child(window_layer, text_layer_get_layer(high_score_layer));
  layer_add_child(window_layer, text_layer_get_layer(option_shadows_layer));
  layer_add_child(window_layer, s_title_pane_layer);
  if (persist_exists(HIGH_SCORE_KEY)) {
    itoa10(persist_read_int(HIGH_SCORE_KEY), high_score_buffer);
  }
  else {
    itoa10(0, high_score_buffer);
  }
  // Fool strcat into thinking the string is empty.
  high_score_str[0] = '\0';
  strcat(high_score_str, "High score: ");
  text_layer_set_text(high_score_layer, strcat(high_score_str, high_score_buffer));
  layer_mark_dirty(s_title_pane_layer);
}
Esempio n. 2
0
/**
 * this method should invoked on the main thread only
 */
void printWithLength(char *line) {
	/**
	 * this is my way to detect serial port transmission errors
	 * following code is functionally identical to
	 *   print("line:%d:%s\r\n", len, line);
	 * but it is faster because it outputs the whole buffer, not single characters
	 * We need this optimization because when we output larger chunks of data like the wave_chart:
	 * When we work with actual hardware, it is faster to invoke 'chSequentialStreamWrite' for the
	 * whole buffer then to invoke 'chSequentialStreamPut' once per character.
	 */
	int len = efiStrlen(line);
	strcpy(header, "line:");
	char *p = header + efiStrlen(header);
	p = itoa10(p, len);
	*p++ = ':';
	*p++ = '\0';

	p = line;
	p += len;
	*p++ = '\r';
	*p++ = '\n';

	if (!isConsoleReady())
		return;
	consoleOutputBuffer((const uint8_t *) header, strlen(header));
	consoleOutputBuffer((const uint8_t *) line, p - line);
}
Esempio n. 3
0
char *itos( int i )

{
	static char s[20];

	return itoa10(i,s);
}
Esempio n. 4
0
static char * prepareCltIatTpsLine(Engine *engine, char *buffer) {
	char *ptr = buffer;
	*ptr++ = 'C';

	ptr = appendStr(ptr, " TP");
	ptr = itoa10(ptr, (int) getTPS(PASS_ENGINE_PARAMETER_F));
	return ptr;
}
Esempio n. 5
0
void updateHD44780lcd(void) {

	lcd_HD44780_set_position(0, 9);
	/**
	 * this would blink so that we know the LCD is alive
	 */
	if (getTimeNowSeconds() % 2 == 0) {
		lcd_HD44780_print_char('R');
	} else {
		lcd_HD44780_print_char(' ');
	}
	lcd_HD44780_set_position(0, 10);

	char * ptr = itoa10(buffer, getRpm());
	ptr[0] = 0;
	int len = ptr - buffer;
	for (int i = 0; i < 6 - len; i++) {
		lcd_HD44780_print_char(' ');
	}
	lcd_HD44780_print_string(buffer);

	if (hasFirmwareError()) {
		memcpy(buffer, getFirmwareError(), LCD_WIDTH);
		buffer[LCD_WIDTH] = 0;
		lcd_HD44780_set_position(1, 0);
		lcd_HD44780_print_string(buffer);
		return;
	}

	lcd_HD44780_set_position(1, 0);
	memset(buffer, ' ', LCD_WIDTH);
	memcpy(buffer, getWarninig(), LCD_WIDTH);
	buffer[LCD_WIDTH] = 0;
	lcd_HD44780_print_string(buffer);

	if (engineConfiguration->HD44780height < 3) {
		return;
	}

	int index = (getTimeNowSeconds() / 2) % (NUMBER_OF_DIFFERENT_LINES / 2);

	prepareCurrentSecondLine(index);
	buffer[LCD_WIDTH] = 0;
	lcd_HD44780_set_position(2, 0);
	lcd_HD44780_print_string(buffer);

	prepareCurrentSecondLine(index + NUMBER_OF_DIFFERENT_LINES / 2);
	buffer[LCD_WIDTH] = 0;
	lcd_HD44780_set_position(3, 0);
	lcd_HD44780_print_string(buffer);

#if EFI_PROD_CODE
	dateToString(dateBuffer);
	lcd_HD44780_set_position(1, 0);
	lcd_HD44780_print_string(dateBuffer);
#endif /* EFI_PROD_CODE */
}
Esempio n. 6
0
static void test_itoa36(CuTest * tc)
{
  CuAssertStrEquals(tc, itoa36(0), "0");
  CuAssertStrEquals(tc, itoa10(INT_MAX), "2147483647");
  CuAssertStrEquals(tc, itoab(-1, 5), "-1");
  CuAssertStrEquals(tc, itoa36(-1), "-1");
  CuAssertStrEquals(tc, itoa36(-10), "-a");
  CuAssertStrEquals(tc, itoa36(666), "ii");
}
static void eval_int(opstack ** stack, const void *userdata)
{
    int i = opop_i(stack);
    const char *c = itoa10(i);
    size_t len = strlen(c);
    variant var;

    var.v = strcpy(balloc(len + 1), c);
    opush(stack, var);
}
Esempio n. 8
0
static char * prepareCltIatTpsLine(char *buffer) {
	char *ptr = buffer;
	*ptr++ = 'C';
	ptr = ftoa(ptr, getCoolantTemperature(), 10.0f);

	ptr = appendStr(ptr, " C");
	ptr = ftoa(ptr, getIntakeAirTemperature(), 10.0f);

	ptr = appendStr(ptr, " TP");
	ptr = itoa10(ptr, (int) getTPS());
	return ptr;
}
Esempio n. 9
0
static ALWAYS_INLINE void reportEventToWaveChart(trigger_event_e ckpSignalType, int index DECLARE_ENGINE_PARAMETER_S) {
	itoa10(&shaft_signal_msg_index[2], index);
	bool_t isUp = isUpEvent[(int) ckpSignalType];
	shaft_signal_msg_index[0] = isUp ? 'u' : 'd';

	addWaveChartEvent(eventId[(int )ckpSignalType], (char* ) shaft_signal_msg_index);
	if (engineConfiguration->useOnlyFrontForTrigger) {
		// let's add the opposite event right away
		shaft_signal_msg_index[0] = isUp ? 'd' : 'u';
		addWaveChartEvent(eventId[(int )ckpSignalType], (char* ) shaft_signal_msg_index);
	}
}
Esempio n. 10
0
static void put2(int offset, char *lcd_str, int value) {
	static char buff[_MAX_FILLER];
	efiAssertVoid(value >=0 && value <100, "value");
	itoa10(buff, value);
	if (value < 10) {
		lcd_str[offset] = '0';
		lcd_str[offset + 1] = buff[0];
	} else {
		lcd_str[offset] = buff[0];
		lcd_str[offset + 1] = buff[1];
	}
}
Esempio n. 11
0
	void PeriodicTask(efitime_t nowNt) override
	{
		if (nowNt >= lastSetTimerTimeNt + 2 * CORE_CLOCK) {
			strcpy(buff, "no_event");
			itoa10(&buff[8], lastSetTimerValue);
			firmwareError(CUSTOM_ERR_SCHEDULING_ERROR, buff);
			return;
		}

		msg = isTimerPending ? "No_cb too long" : "Timer not awhile";
		// 2 seconds of inactivity would not look right
		efiAssertVoid(CUSTOM_ERR_6682, nowNt < lastSetTimerTimeNt + 2 * CORE_CLOCK, msg);
	}
Esempio n. 12
0
static void usTimerWatchDog(void) {
	if (getTimeNowNt() >= lastSetTimerTimeNt + 2 * CORE_CLOCK) {
		strcpy(buff, "no_event");
		itoa10(&buff[8], lastSetTimerValue);
		firmwareError(OBD_PCM_Processor_Fault, buff);
		return;
	}

	msg = isTimerPending ? "No_cb too long" : "Timer not awhile";
	// 2 seconds of inactivity would not look right
	efiAssertVoid(getTimeNowNt() < lastSetTimerTimeNt + 2 * CORE_CLOCK, msg);

}
Esempio n. 13
0
char * getPinNameByAdcChannel(const char *msg, adc_channel_e hwChannel, char *buffer) {
#if HAL_USE_ADC || defined(__DOXYGEN__)
	if (hwChannel == EFI_ADC_NONE) {
		strcpy(buffer, "NONE");
	} else {
		strcpy((char*) buffer, portname(getAdcChannelPort(msg, hwChannel)));
		itoa10(&buffer[2], getAdcChannelPin(hwChannel));
	}
#else
	strcpy(buffer, "NONE");
#endif
	return (char*) buffer;
}
Esempio n. 14
0
/**
 * @brief	Register an event for digital sniffer
 */
void addWaveChartEvent3(WaveChart *chart, const char *name, const char * msg, const char * msg2) {
	efiAssertVoid(chart->isInitialized, "chart not initialized");
#if DEBUG_WAVE
	scheduleSimpleMsg(&debugLogging, "current", chart->counter);
#endif
	if (isWaveChartFull(chart)) {
		return;
	}

#if EFI_HISTOGRAMS && EFI_PROD_CODE
	int beforeCallback = hal_lld_get_counter_value();
#endif

	int time100 = getTimeNowUs() / 10;

	bool alreadyLocked = lockOutputBuffer(); // we have multiple threads writing to the same output buffer

	if (chart->counter == 0) {
		chart->startTime = time100;
	}
	chart->counter++;
	if (remainingSize(&chart->logging) > 30) {
		/**
		 * printf is a heavy method, append is used here as a performance optimization
		 */
		appendFast(&chart->logging, name);
		appendFast(&chart->logging, CHART_DELIMETER);
		appendFast(&chart->logging, msg);
		appendFast(&chart->logging, CHART_DELIMETER);
		/**
		 * We want smaller times within a chart in order to reduce packet size.
		 */
		time100 -= chart->startTime;

		itoa10(timeBuffer, time100);
		appendFast(&chart->logging, timeBuffer);
		appendFast(&chart->logging, msg2);
		appendFast(&chart->logging, CHART_DELIMETER);
	}
	if (!alreadyLocked) {
		unlockOutputBuffer();
	}

#if EFI_HISTOGRAMS && EFI_PROD_CODE
	int64_t diff = hal_lld_get_counter_value() - beforeCallback;
	if (diff > 0) {
		hsAdd(&waveChartHisto, diff);
	}
#endif /* EFI_HISTOGRAMS */

}
Esempio n. 15
0
/**
 * @brief Shaft position callback used by RPM calculation logic.
 *
 * This callback is invoked on interrupt thread.
 */
static void shaftPositionCallback(ShaftEvents ckpSignalType, int index) {
	itoa10(&shaft_signal_msg_index[1], index);
	if (ckpSignalType == SHAFT_PRIMARY_UP) {
		addWaveChartEvent("crank", "up", shaft_signal_msg_index);
	} else if (ckpSignalType == SHAFT_PRIMARY_DOWN) {
		addWaveChartEvent("crank", "down", shaft_signal_msg_index);
	} else if (ckpSignalType == SHAFT_SECONDARY_UP) {
		addWaveChartEvent("crank2", "up", shaft_signal_msg_index);
	} else if (ckpSignalType == SHAFT_SECONDARY_DOWN) {
		addWaveChartEvent("crank2", "down", shaft_signal_msg_index);
	}


	if (index != 0) {
#if EFI_PROD_CODE || EFI_SIMULATOR
		if (engineConfiguration->analogChartMode == AC_TRIGGER)
			acAddData(getCrankshaftAngle(chTimeNow()), 1000 * ckpSignalType + index);
#endif
		return;
	}
	rpmState.revolutionCounter++;

	time_t now = chTimeNow();

	int hadRpmRecently = isRunning();

	if (hadRpmRecently) {
		if (isNoisySignal(&rpmState, now)) {
			// unexpected state. Noise?
			rpmState.rpm = NOISY_RPM;
		} else {
			int diff = now - rpmState.lastRpmEventTime;
			// 60000 because per minute
			// * 2 because each revolution of crankshaft consists of two camshaft revolutions
			// / 4 because each cylinder sends a signal
			// need to measure time from the previous non-skipped event

			int rpm = (int)(60000 * TICKS_IN_MS / engineConfiguration->rpmMultiplier / diff);
			rpmState.rpm = rpm > UNREALISTIC_RPM ? NOISY_RPM : rpm;
		}
	}
	rpmState.lastRpmEventTime = now;
#if EFI_PROD_CODE || EFI_SIMULATOR
	if (engineConfiguration->analogChartMode == AC_TRIGGER)
		acAddData(getCrankshaftAngle(now), index);
#endif
}
Esempio n. 16
0
void date_to_words(Language lang, int day, int date, int month, char* words, size_t buffer_size) {
  size_t remaining = buffer_size;
  memset(words, 0, buffer_size);
  
  const char* stringday = get_day(lang, day);
  const char* stringmonth = get_month(lang, month);
  
  char stringdate[15];
  itoa10(date, stringdate);
  
  remaining -= append_string(words, remaining, stringday);
  remaining -= append_string(words, remaining, "  ");
  remaining -= append_string(words, remaining, stringmonth);
  remaining -= append_string(words, remaining, " ");
  remaining -= append_string(words, remaining, stringdate);
  remaining -= append_string(words, remaining, " ");
}
Esempio n. 17
0
void rusEfiFunctionalTest(void) {
	printToConsole("Running rusEfi simulator version:");
	static char versionBuffer[20];
	itoa10(versionBuffer, (int)getRusEfiVersion());
	printToConsole(versionBuffer);

	initIntermediateLoggingBuffer();
	initErrorHandling();

	engine->setConfig(config);

	initializeConsole(&sharedLogger);

	initStatusLoop();
	initDataStructures(PASS_ENGINE_PARAMETER_SIGNATURE);


	// todo: reduce code duplication with initEngineContoller

	resetConfigurationExt(NULL, FORD_ESCORT_GT PASS_ENGINE_PARAMETER_SUFFIX);
	prepareShapes(PASS_ENGINE_PARAMETER_SIGNATURE);

	initAlgo(&sharedLogger);
	commonInitEngineController(&sharedLogger);

	initRpmCalculator(&sharedLogger PASS_ENGINE_PARAMETER_SUFFIX);

	initTriggerCentral(&sharedLogger);
	initTriggerEmulator(&sharedLogger PASS_ENGINE_PARAMETER_SUFFIX);
#if EFI_MAP_AVERAGING
	initMapAveraging(&sharedLogger, engine);
#endif /* EFI_MAP_AVERAGING */

	initMainEventListener(&sharedLogger PASS_ENGINE_PARAMETER_SUFFIX);

	startStatusThreads();

	runChprintfTest();

	initPeriodicEvents(PASS_ENGINE_PARAMETER_SIGNATURE);

	setTriggerEmulatorRPM(DEFAULT_SIM_RPM PASS_ENGINE_PARAMETER_SUFFIX);
	engineConfiguration->engineSnifferRpmThreshold = DEFAULT_SNIFFER_THR;
}
Esempio n. 18
0
static msg_t mwThread(int param) {
	chRegSetThreadName("timer watchdog");

	while (TRUE) {
		chThdSleepMilliseconds(1000); // once a second is enough

		if (getTimeNowUs() >= lastSetTimerTime + 2 * US_PER_SECOND) {
			strcpy(buff, "no_event");
			itoa10(&buff[8], lastSetTimerValue);
			firmwareError(buff);
			return -1;
		}

		msg = isTimerPending ? "No_cb too long" : "Timer not awhile";
		// 2 seconds of inactivity would not look right
		efiAssert(getTimeNowUs() < lastSetTimerTime + 2 * US_PER_SECOND, msg, -1);
	}
#if defined __GNUC__
	return -1;
#endif        
}
Esempio n. 19
0
static ALWAYS_INLINE void reportEventToWaveChart(trigger_event_e ckpSignalType, int index) {
	itoa10(&shaft_signal_msg_index[2], index);
	if (ckpSignalType == SHAFT_PRIMARY_UP) {
		shaft_signal_msg_index[0] = 'u';
		addWaveChartEvent(WC_CRANK1, (char* ) shaft_signal_msg_index);
	} else if (ckpSignalType == SHAFT_PRIMARY_DOWN) {
		shaft_signal_msg_index[0] = 'd';
		addWaveChartEvent(WC_CRANK1, (char* ) shaft_signal_msg_index);
	} else if (ckpSignalType == SHAFT_SECONDARY_UP) {
		shaft_signal_msg_index[0] = 'u';
		addWaveChartEvent(WC_CRANK2, (char* ) shaft_signal_msg_index);
	} else if (ckpSignalType == SHAFT_SECONDARY_DOWN) {
		shaft_signal_msg_index[0] = 'd';
		addWaveChartEvent(WC_CRANK2, (char* ) shaft_signal_msg_index);
	} else if (ckpSignalType == SHAFT_3RD_UP) {
		shaft_signal_msg_index[0] = 'u';
		addWaveChartEvent(WC_CRANK3, (char* ) shaft_signal_msg_index);
	} else if (ckpSignalType == SHAFT_3RD_DOWN) {
		shaft_signal_msg_index[0] = 'd';
		addWaveChartEvent(WC_CRANK3, (char* ) shaft_signal_msg_index);
	}
}
Esempio n. 20
0
std::size_t dtoa10(char* out, std::size_t max, double number)
{
	int decPoint = 0;

	// write the unary minus to indicate we have a negative number
	std::size_t written = 1u;

	if (number < 0 && written < max)
	{
		*out++ = '-';
		++written;
		number = -number;
	}

	// calculating decimal point position.
	while (number >= 10.0)
	{
		decPoint++;
		number /= 10;
	}

	std::size_t loopMax = max < 6 ? max : 6;

	for (std::size_t loop = 0; loop < loopMax; loop++)
	{
		if (number == 0.0)
		{
			if (loop == 1)
			{
				*out++ = '0';
				written++;
			}
			break;
		}

		char tmp = (char)number;
		number -= tmp;
		number *= 10.0;

		*out++ = '0' + tmp;

		if (loop == 0)
		{
			*out++ = '.';
		}

		written++;
	}

	if (decPoint > 0)
	{
		char buf[MAX_PATH];
		auto nums = itoa10(buf, MAX_PATH, decPoint);
		if (written + nums + 2 < max)
		{
			*out++ = 'e';
			*out++ = '+';
			std::memcpy(out, buf, nums);
			out += nums;

			written += nums + 2;
		}
	}

	// append a terminal zero
	*out++ = '\0';

	return written;
}
Esempio n. 21
0
void number_text(unsigned long number)
{
   int digit;
   puts(itoa10(number));
   puts(": ");
   if(number >= 1000000000)
   {
      digit = number / 1000000000;
      puts(name[digit]);
      puts(" billion ");
      number %= 1000000000;
   }
   if(number >= 100000000)
   {
      digit = number / 100000000;
      puts(name[digit]);
      puts(" hundred ");
      number %= 100000000;
      if(number < 1000000)
      {
         puts("million ");
      }
   }
   if(number >= 20000000)
   {
      digit = number / 10000000;
      puts(name[digit + 20]);
      putchar(' ');
      number %= 10000000;
      if(number < 1000000)
      {
         puts("million ");
      }
   }
   if(number >= 1000000)
   {
      digit = number / 1000000;
      puts(name[digit]);
      puts(" million ");
      number %= 1000000;
   }
   if(number >= 100000)
   {
      digit = number / 100000;
      puts(name[digit]);
      puts(" hundred ");
      number %= 100000;
      if(number < 1000)
      {
         puts("thousand ");
      }
   }
   if(number >= 20000)
   {
      digit = number / 10000;
      puts(name[digit + 20]);
      putchar(' ');
      number %= 10000;
      if(number < 1000)
      {
         puts("thousand ");
      }
   }
   if(number >= 1000)
   {
      digit = number / 1000;
      puts(name[digit]);
      puts(" thousand ");
      number %= 1000;
   }
   if(number >= 100)
   {
      digit = number / 100;
      puts(name[digit]);
      puts(" hundred ");
      number %= 100;
   }
   if(number >= 20)
   {
      digit = number / 10;
      puts(name[digit + 20]);
      putchar(' ');
      number %= 10;
   }
   puts(name[number]);
   putchar ('\r');
   putchar ('\n');
}
Esempio n. 22
0
void initHardware() {
	// todo: enable protection. it's disabled because it takes
	// 10 extra seconds to re-flash the chip
	//flashProtect();

	/**
	 * histograms is a data structure for CPU monitor, it does not depend on configuration
	 */
	initHistogramsModule();



	/**
	 * We need the LED_ERROR pin even before we read configuration
	 */
	initPrimaryPins();

	/**
	 * this call reads configuration from flash memory or sets default configuration
	 * if flash state does not look right.
	 */
	initFlash();

	initRtc();

	initOutputPins();
	initAdcInputs();

#if EFI_HIP_9011
	initHip9011();
#endif /* EFI_HIP_9011 */

#if EFI_CAN_SUPPORT
	initCan();
#endif /* EFI_CAN_SUPPORT */

//	init_adc_mcp3208(&adcState, &SPID2);
//	requestAdcValue(&adcState, 0);


	// todo: figure out better startup logic
	initTriggerCentral();
	initShaftPositionInputCapture();

	initSpiModules();

#if EFI_FILE_LOGGING
	initMmcCard();
#endif /* EFI_FILE_LOGGING */

//	initFixedLeds();

	//	initBooleanInputs();

#if EFI_UART_GPS
	initGps();
#endif

#if ADC_SNIFFER
	initAdcDriver();
#endif

#if EFI_HD44780_LCD
//	initI2Cmodule();
	lcd_HD44780_init();

	char buffer[16];
	itoa10(buffer, SVN_VERSION);
	lcd_HD44780_print_string(buffer);

#endif

	addConsoleActionII("i2c", sendI2Cbyte);

//	while (true) {
//		for (int addr = 0x20; addr < 0x28; addr++) {
//			sendI2Cbyte(addr, 0);
//			int err = i2cGetErrors(&I2CD1);
//			print("I2C: err=%x from %d\r\n", err, addr);
//			chThdSleepMilliseconds(5);
//			sendI2Cbyte(addr, 255);
//			chThdSleepMilliseconds(5);
//		}
//	}

	initBoardTest();

}
Esempio n. 23
0
static void onTdcCallback(void) {
	itoa10(rpmBuffer, getRpm());
	addWaveChartEvent(TOP_DEAD_CENTER_MESSAGE, rpmBuffer, "");
}
Esempio n. 24
0
/**
 * @brief	Register an event for digital sniffer
 */
void WaveChart::addEvent3(const char *name, const char * msg) {
#if EFI_TEXT_LOGGING
	if (!ENGINE(isEngineChartEnabled)) {
		return;
	}
	if (skipUntilEngineCycle != 0 && ENGINE(rpmCalculator.getRevolutionCounter()) < skipUntilEngineCycle)
		return;
#if EFI_SIMULATOR
	// todo: add UI control to enable this for firmware if desired
	// CONFIG(alignEngineSnifferAtTDC) &&
	if (!collectingData) {
		return;
	}
#endif
	efiAssertVoid(CUSTOM_ERR_6651, name!=NULL, "WC: NULL name");

#if EFI_PROD_CODE
	efiAssertVoid(CUSTOM_ERR_6652, getCurrentRemainingStack() > 32, "lowstck#2c");
#endif /* EFI_PROD_CODE */

	efiAssertVoid(CUSTOM_ERR_6653, isInitialized, "chart not initialized");
#if DEBUG_WAVE
	scheduleSimpleMsg(&debugLogging, "current", chart->counter);
#endif /* DEBUG_WAVE */
	if (isFull()) {
		return;
	}

#if EFI_HISTOGRAMS && EFI_PROD_CODE
	int beforeCallback = hal_lld_get_counter_value();
#endif

	efitick_t nowNt = getTimeNowNt();

	bool alreadyLocked = lockOutputBuffer(); // we have multiple threads writing to the same output buffer

	if (counter == 0) {
		startTimeNt = nowNt;
	}
	counter++;

	/**
	 * We want smaller times within a chart in order to reduce packet size.
	 */
	/**
	 * todo: migrate to binary fractions in order to eliminate
	 * this division? I do not like division
	 *
	 * at least that's 32 bit division now
	 */
	uint32_t diffNt = nowNt - startTimeNt;
	uint32_t time100 = NT2US(diffNt / 10);

	if (remainingSize(&logging) > 35) {
		/**
		 * printf is a heavy method, append is used here as a performance optimization
		 */
		appendFast(&logging, name);
		appendChar(&logging, CHART_DELIMETER);
		appendFast(&logging, msg);
		appendChar(&logging, CHART_DELIMETER);
//		time100 -= startTime100;

		itoa10(timeBuffer, time100);
		appendFast(&logging, timeBuffer);
		appendChar(&logging, CHART_DELIMETER);
		logging.linePointer[0] = 0;
	}
	if (!alreadyLocked) {
		unlockOutputBuffer();
	}

#if EFI_HISTOGRAMS && EFI_PROD_CODE
	int64_t diff = hal_lld_get_counter_value() - beforeCallback;
	if (diff > 0) {
		hsAdd(&engineSnifferHisto, diff);
	}
#endif /* EFI_HISTOGRAMS */
#endif /* EFI_TEXT_LOGGING */
}
Esempio n. 25
0
void _php_format_uint8(char *buf, uint8_t *value_ptr)
{
    itoa10(*value_ptr, buf);
}