summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nanotimer/nanotimer.cbp598
-rw-r--r--nanotimer/nanotimer.ino17
2 files changed, 14 insertions, 601 deletions
diff --git a/nanotimer/nanotimer.cbp b/nanotimer/nanotimer.cbp
deleted file mode 100644
index b71cb5e..0000000
--- a/nanotimer/nanotimer.cbp
+++ /dev/null
@@ -1,598 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<CodeBlocks_project_file>
- <FileVersion major="1" minor="6" />
- <Project>
- <Option title="pbox" />
- <Option pch_mode="2" />
- <Option compiler="avrgcc" />
- <Build>
- <Target title="Simulator">
- <Option output="bin/Release/obdlogger_sim.exe" prefix_auto="1" extension_auto="0" />
- <Option object_output="obj/Release/" />
- <Option type="1" />
- <Option compiler="GCC" />
- <Compiler>
- <Add option="-Os" />
- <Add option="-DF_CPU=16000000L" />
- <Add option="-DARDUSIM" />
- <Add option="-D__AVR_ATmega2560__" />
- <Add option="-x c++" />
- <Add directory="$(ARDUINO_DIR)/arduino/cores" />
- <Add directory="$(ARDUINO_DIR)/arduino/variants/standard" />
- <Add directory="$(ARDUINO_DIR)/include" />
- </Compiler>
- <Linker>
- <Add option="-lardusim" />
- </Linker>
- <Environment>
- <Variable name="ARDUINO_DIR" value="$(APP_PATH)\ardusim" />
- </Environment>
- </Target>
- <Target title="Arduino Uno">
- <Option output="bin/Release/obdlogger_${BOARD_ID}.elf" prefix_auto="1" extension_auto="0" />
- <Option type="1" />
- <Option compiler="avrgcc" />
- <Compiler>
- <Add option="-Os" />
- <Add option="-x c++" />
- <Add option="-mmcu=$(MCU)" />
- <Add option="-DF_CPU=16000000L" />
- <Add option="-D__AVR_ATmega328P__" />
- <Add directory="$(ARDUINO_DIR)/hardware/arduino/cores/arduino" />
- <Add directory="$(ARDUINO_DIR)/libraries" />
- <Add directory="$(ARDUINO_DIR)/hardware/arduino/variants/standard" />
- </Compiler>
- <Linker>
- <Add option="-mmcu=$(MCU)" />
- <Add option='&quot;$(PROJECT_DIR)bin/lib_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- <Add option='&quot;$(PROJECT_DIR)bin/core_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- </Linker>
- <ExtraCommands>
- <Add before='$(TARGET_COMPILER_DIR)ArduinoUploader &quot;$(PROJECT_DIR).&quot; $(BOARD_ID) - $(MCU_CLOCK) 0 &quot;$(PROJECT_DIR)bin/lib_${BOARD_ID}_${MCU_CLOCK}.a&quot; &quot;$(PROJECT_DIR)bin/core_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- <Add after='avr-objcopy -O ihex -R .eeprom -R .eesafe &quot;$(TARGET_OUTPUT_FILE)&quot; &quot;$(TARGET_OUTPUT_FILE).hex&quot;' />
- <Add after='avr-objcopy --no-change-warnings -j .eeprom --change-section-lma .eeprom=0 -O ihex &quot;$(TARGET_OUTPUT_FILE)&quot; &quot;$(TARGET_OUTPUT_FILE).eep.hex&quot;' />
- <Add after='avr-size --mcu=$(MCU) --format=avr &quot;$(TARGET_OUTPUT_FILE)&quot;' />
- </ExtraCommands>
- <Environment>
- <Variable name="BOARD" value="Arduino Uno" />
- <Variable name="BOARD_ID" value="uno" />
- <Variable name="MCU" value="atmega328p" />
- <Variable name="MCU_CLOCK" value="16" />
- <Variable name="UPLOAD_BAUDRATE" value="115200" />
- <Variable name="UPLOAD_PORT" value="" />
- </Environment>
- </Target>
- <Target title="Arduino Leonardo">
- <Option output="bin/Release/obdlogger_${BOARD_ID}.elf" prefix_auto="1" extension_auto="0" />
- <Option type="1" />
- <Option compiler="avrgcc" />
- <Compiler>
- <Add option="-x c++" />
- <Add option="-mmcu=$(MCU)" />
- <Add option="-DF_CPU=16000000L" />
- <Add option="-D__AVR_ATmega32U4__" />
- <Add option="-DUSB_VID=0x2341" />
- <Add option="-DUSB_PID=0x8036" />
- <Add option="-Os" />
- <Add directory="$(ARDUINO_DIR)/hardware/arduino/cores/arduino" />
- <Add directory="$(ARDUINO_DIR)/libraries" />
- <Add directory="$(ARDUINO_DIR)/hardware/arduino/variants/leonardo" />
- </Compiler>
- <Linker>
- <Add option="-mmcu=$(MCU)" />
- <Add option='&quot;$(PROJECT_DIR)bin/lib_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- <Add option='&quot;$(PROJECT_DIR)bin/core_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- </Linker>
- <ExtraCommands>
- <Add before='$(TARGET_COMPILER_DIR)ArduinoUploader &quot;$(PROJECT_DIR).&quot; $(BOARD_ID) - $(MCU_CLOCK) 0 &quot;$(PROJECT_DIR)bin/lib_${BOARD_ID}_${MCU_CLOCK}.a&quot; &quot;$(PROJECT_DIR)bin/core_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- <Add after='avr-objcopy -O ihex -R .eeprom -R .eesafe &quot;$(TARGET_OUTPUT_FILE)&quot; &quot;$(TARGET_OUTPUT_FILE).hex&quot;' />
- <Add after='avr-objcopy --no-change-warnings -j .eeprom --change-section-lma .eeprom=0 -O ihex &quot;$(TARGET_OUTPUT_FILE)&quot; &quot;$(TARGET_OUTPUT_FILE).eep.hex&quot;' />
- <Add after='avr-size --mcu=$(MCU) --format=avr &quot;$(TARGET_OUTPUT_FILE)&quot;' />
- </ExtraCommands>
- <Environment>
- <Variable name="BOARD" value="Arduino Leonardo" />
- <Variable name="BOARD_ID" value="leonardo" />
- <Variable name="MCU" value="atmega32u4" />
- <Variable name="MCU_CLOCK" value="16" />
- <Variable name="UPLOAD_BAUDRATE" value="57600" />
- <Variable name="UPLOAD_PORT" value="" />
- </Environment>
- </Target>
- <Target title="Arduino Esplora">
- <Option output="bin/Release/obdlogger_${BOARD_ID}.elf" prefix_auto="1" extension_auto="0" />
- <Option type="1" />
- <Option compiler="avrgcc" />
- <Compiler>
- <Add option="-x c++" />
- <Add option="-mmcu=$(MCU)" />
- <Add option="-DF_CPU=16000000L" />
- <Add option="-D__AVR_ATmega32U4__" />
- <Add option="-DUSB_VID=0x2341" />
- <Add option="-DUSB_PID=0x8037" />
- <Add option="-Os" />
- <Add directory="$(ARDUINO_DIR)/hardware/arduino/cores/arduino" />
- <Add directory="$(ARDUINO_DIR)/libraries" />
- <Add directory="$(ARDUINO_DIR)/hardware/arduino/variants/leonardo" />
- </Compiler>
- <Linker>
- <Add option="-mmcu=$(MCU)" />
- <Add option='&quot;$(PROJECT_DIR)bin/lib_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- <Add option='&quot;$(PROJECT_DIR)bin/core_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- </Linker>
- <ExtraCommands>
- <Add before='$(TARGET_COMPILER_DIR)ArduinoUploader &quot;$(PROJECT_DIR).&quot; $(BOARD_ID) - $(MCU_CLOCK) 0 &quot;$(PROJECT_DIR)bin/lib_${BOARD_ID}_${MCU_CLOCK}.a&quot; &quot;$(PROJECT_DIR)bin/core_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- <Add after='avr-objcopy -O ihex -R .eeprom -R .eesafe &quot;$(TARGET_OUTPUT_FILE)&quot; &quot;$(TARGET_OUTPUT_FILE).hex&quot;' />
- <Add after='avr-objcopy --no-change-warnings -j .eeprom --change-section-lma .eeprom=0 -O ihex &quot;$(TARGET_OUTPUT_FILE)&quot; &quot;$(TARGET_OUTPUT_FILE).eep.hex&quot;' />
- <Add after='avr-size --mcu=$(MCU) --format=avr &quot;$(TARGET_OUTPUT_FILE)&quot;' />
- </ExtraCommands>
- <Environment>
- <Variable name="BOARD" value="Arduino Esplora" />
- <Variable name="BOARD_ID" value="esplora" />
- <Variable name="MCU" value="atmega32u4" />
- <Variable name="MCU_CLOCK" value="16" />
- <Variable name="UPLOAD_BAUDRATE" value="57600" />
- <Variable name="UPLOAD_PORT" value="" />
- </Environment>
- </Target>
- <Target title="Arduino Micro">
- <Option output="bin/Release/obdlogger_${BOARD_ID}.elf" prefix_auto="1" extension_auto="0" />
- <Option type="1" />
- <Option compiler="avrgcc" />
- <Compiler>
- <Add option="-x c++" />
- <Add option="-mmcu=$(MCU)" />
- <Add option="-DF_CPU=16000000L" />
- <Add option="-D__AVR_ATmega32U4__" />
- <Add option="-DUSB_VID=0x2341" />
- <Add option="-DUSB_PID=0x803C" />
- <Add option="-Os" />
- <Add directory="$(ARDUINO_DIR)/hardware/arduino/cores/arduino" />
- <Add directory="$(ARDUINO_DIR)/libraries" />
- <Add directory="$(ARDUINO_DIR)/hardware/arduino/variants/micro" />
- </Compiler>
- <Linker>
- <Add option="-mmcu=$(MCU)" />
- <Add option='&quot;$(PROJECT_DIR)bin/lib_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- <Add option='&quot;$(PROJECT_DIR)bin/core_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- </Linker>
- <ExtraCommands>
- <Add before='$(TARGET_COMPILER_DIR)ArduinoUploader &quot;$(PROJECT_DIR).&quot; $(BOARD_ID) - $(MCU_CLOCK) 0 &quot;$(PROJECT_DIR)bin/lib_${BOARD_ID}_${MCU_CLOCK}.a&quot; &quot;$(PROJECT_DIR)bin/core_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- <Add after='avr-objcopy -O ihex -R .eeprom -R .eesafe &quot;$(TARGET_OUTPUT_FILE)&quot; &quot;$(TARGET_OUTPUT_FILE).hex&quot;' />
- <Add after='avr-objcopy --no-change-warnings -j .eeprom --change-section-lma .eeprom=0 -O ihex &quot;$(TARGET_OUTPUT_FILE)&quot; &quot;$(TARGET_OUTPUT_FILE).eep.hex&quot;' />
- <Add after='avr-size --mcu=$(MCU) --format=avr &quot;$(TARGET_OUTPUT_FILE)&quot;' />
- </ExtraCommands>
- <Environment>
- <Variable name="BOARD" value="Arduino Micro" />
- <Variable name="BOARD_ID" value="micro" />
- <Variable name="MCU" value="atmega32u4" />
- <Variable name="MCU_CLOCK" value="16" />
- <Variable name="UPLOAD_BAUDRATE" value="57600" />
- <Variable name="UPLOAD_PORT" value="" />
- </Environment>
- </Target>
- <Target title="Arduino Duemilanove (328)">
- <Option output="bin/Release/obdlogger_${BOARD_ID}.elf" prefix_auto="1" extension_auto="0" />
- <Option type="1" />
- <Option compiler="avrgcc" />
- <Compiler>
- <Add option="-x c++" />
- <Add option="-mmcu=$(MCU)" />
- <Add option="-DF_CPU=16000000L" />
- <Add option="-D__AVR_ATmega328P__" />
- <Add option="-Os" />
- <Add directory="$(ARDUINO_DIR)/hardware/arduino/cores/arduino" />
- <Add directory="$(ARDUINO_DIR)/libraries" />
- <Add directory="$(ARDUINO_DIR)/hardware/arduino/variants/standard" />
- </Compiler>
- <Linker>
- <Add option="-mmcu=$(MCU)" />
- <Add option='&quot;$(PROJECT_DIR)bin/lib_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- <Add option='&quot;$(PROJECT_DIR)bin/core_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- </Linker>
- <ExtraCommands>
- <Add before='$(TARGET_COMPILER_DIR)ArduinoUploader &quot;$(PROJECT_DIR).&quot; $(BOARD_ID) - $(MCU_CLOCK) 0 &quot;$(PROJECT_DIR)bin/lib_${BOARD_ID}_${MCU_CLOCK}.a&quot; &quot;$(PROJECT_DIR)bin/core_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- <Add after='avr-objcopy -O ihex -R .eeprom -R .eesafe &quot;$(TARGET_OUTPUT_FILE)&quot; &quot;$(TARGET_OUTPUT_FILE).hex&quot;' />
- <Add after='avr-objcopy --no-change-warnings -j .eeprom --change-section-lma .eeprom=0 -O ihex &quot;$(TARGET_OUTPUT_FILE)&quot; &quot;$(TARGET_OUTPUT_FILE).eep.hex&quot;' />
- <Add after='avr-size --mcu=$(MCU) --format=avr &quot;$(TARGET_OUTPUT_FILE)&quot;' />
- </ExtraCommands>
- <Environment>
- <Variable name="BOARD" value="Arduino Duemilanove (328)" />
- <Variable name="BOARD_ID" value="duemilanove328" />
- <Variable name="MCU" value="atmega328p" />
- <Variable name="MCU_CLOCK" value="16" />
- <Variable name="UPLOAD_BAUDRATE" value="57600" />
- <Variable name="UPLOAD_PORT" value="" />
- </Environment>
- </Target>
- <Target title="Arduino Duemilanove (168)">
- <Option output="bin/Release/obdlogger_${BOARD_ID}.elf" prefix_auto="1" extension_auto="0" />
- <Option type="1" />
- <Option compiler="avrgcc" />
- <Compiler>
- <Add option="-x c++" />
- <Add option="-mmcu=$(MCU)" />
- <Add option="-DF_CPU=16000000L" />
- <Add option="-D__AVR_ATmega168__" />
- <Add option="-Os" />
- <Add directory="$(ARDUINO_DIR)/hardware/arduino/cores/arduino" />
- <Add directory="$(ARDUINO_DIR)/libraries" />
- <Add directory="$(ARDUINO_DIR)/hardware/arduino/variants/standard" />
- </Compiler>
- <Linker>
- <Add option="-mmcu=$(MCU)" />
- <Add option='&quot;$(PROJECT_DIR)bin/lib_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- <Add option='&quot;$(PROJECT_DIR)bin/core_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- </Linker>
- <ExtraCommands>
- <Add before='$(TARGET_COMPILER_DIR)ArduinoUploader &quot;$(PROJECT_DIR).&quot; $(BOARD_ID) - $(MCU_CLOCK) 0 &quot;$(PROJECT_DIR)bin/lib_${BOARD_ID}_${MCU_CLOCK}.a&quot; &quot;$(PROJECT_DIR)bin/core_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- <Add after='avr-objcopy -O ihex -R .eeprom -R .eesafe &quot;$(TARGET_OUTPUT_FILE)&quot; &quot;$(TARGET_OUTPUT_FILE).hex&quot;' />
- <Add after='avr-objcopy --no-change-warnings -j .eeprom --change-section-lma .eeprom=0 -O ihex &quot;$(TARGET_OUTPUT_FILE)&quot; &quot;$(TARGET_OUTPUT_FILE).eep.hex&quot;' />
- <Add after='avr-size --mcu=$(MCU) --format=avr &quot;$(TARGET_OUTPUT_FILE)&quot;' />
- </ExtraCommands>
- <Environment>
- <Variable name="BOARD" value="Arduino Duemilanove (168)" />
- <Variable name="BOARD_ID" value="duemilanove168" />
- <Variable name="MCU" value="atmega168" />
- <Variable name="MCU_CLOCK" value="16" />
- <Variable name="UPLOAD_BAUDRATE" value="19200" />
- <Variable name="UPLOAD_PORT" value="" />
- </Environment>
- </Target>
- <Target title="Arduino Nano (328)">
- <Option output="bin/Release/obdlogger_${BOARD_ID}.elf" prefix_auto="1" extension_auto="0" />
- <Option type="1" />
- <Option compiler="avrgcc" />
- <Compiler>
- <Add option="-x c++" />
- <Add option="-mmcu=$(MCU)" />
- <Add option="-DF_CPU=16000000L" />
- <Add option="-D__AVR_ATmega328P__" />
- <Add option="-Os" />
- <Add directory="$(ARDUINO_DIR)/hardware/arduino/cores/arduino" />
- <Add directory="$(ARDUINO_DIR)/libraries" />
- <Add directory="$(ARDUINO_DIR)/hardware/arduino/variants/eightanaloginputs" />
- </Compiler>
- <Linker>
- <Add option="-mmcu=$(MCU)" />
- <Add option='&quot;$(PROJECT_DIR)bin/lib_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- <Add option='&quot;$(PROJECT_DIR)bin/core_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- </Linker>
- <ExtraCommands>
- <Add before='$(TARGET_COMPILER_DIR)ArduinoUploader &quot;$(PROJECT_DIR).&quot; $(BOARD_ID) - $(MCU_CLOCK) 0 &quot;$(PROJECT_DIR)bin/lib_${BOARD_ID}_${MCU_CLOCK}.a&quot; &quot;$(PROJECT_DIR)bin/core_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- <Add after='avr-objcopy -O ihex -R .eeprom -R .eesafe &quot;$(TARGET_OUTPUT_FILE)&quot; &quot;$(TARGET_OUTPUT_FILE).hex&quot;' />
- <Add after='avr-objcopy --no-change-warnings -j .eeprom --change-section-lma .eeprom=0 -O ihex &quot;$(TARGET_OUTPUT_FILE)&quot; &quot;$(TARGET_OUTPUT_FILE).eep.hex&quot;' />
- <Add after='avr-size --mcu=$(MCU) --format=avr &quot;$(TARGET_OUTPUT_FILE)&quot;' />
- </ExtraCommands>
- <Environment>
- <Variable name="BOARD" value="Arduino Nano (328)" />
- <Variable name="BOARD_ID" value="nano328" />
- <Variable name="MCU" value="atmega328p" />
- <Variable name="MCU_CLOCK" value="16" />
- <Variable name="UPLOAD_BAUDRATE" value="57600" />
- <Variable name="UPLOAD_PORT" value="" />
- </Environment>
- </Target>
- <Target title="Arduino Nano (168)">
- <Option output="bin/Release/obdlogger_${BOARD_ID}.elf" prefix_auto="1" extension_auto="0" />
- <Option type="1" />
- <Option compiler="avrgcc" />
- <Compiler>
- <Add option="-x c++" />
- <Add option="-mmcu=$(MCU)" />
- <Add option="-DF_CPU=16000000L" />
- <Add option="-D__AVR_ATmega168__" />
- <Add option="-Os" />
- <Add directory="$(ARDUINO_DIR)/hardware/arduino/cores/arduino" />
- <Add directory="$(ARDUINO_DIR)/libraries" />
- <Add directory="$(ARDUINO_DIR)/hardware/arduino/variants/eightanaloginputs" />
- </Compiler>
- <Linker>
- <Add option="-mmcu=$(MCU)" />
- <Add option='&quot;$(PROJECT_DIR)bin/lib_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- <Add option='&quot;$(PROJECT_DIR)bin/core_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- </Linker>
- <ExtraCommands>
- <Add before='$(TARGET_COMPILER_DIR)ArduinoUploader &quot;$(PROJECT_DIR).&quot; $(BOARD_ID) - $(MCU_CLOCK) 0 &quot;$(PROJECT_DIR)bin/lib_${BOARD_ID}_${MCU_CLOCK}.a&quot; &quot;$(PROJECT_DIR)bin/core_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- <Add after='avr-objcopy -O ihex -R .eeprom -R .eesafe &quot;$(TARGET_OUTPUT_FILE)&quot; &quot;$(TARGET_OUTPUT_FILE).hex&quot;' />
- <Add after='avr-objcopy --no-change-warnings -j .eeprom --change-section-lma .eeprom=0 -O ihex &quot;$(TARGET_OUTPUT_FILE)&quot; &quot;$(TARGET_OUTPUT_FILE).eep.hex&quot;' />
- <Add after='avr-size --mcu=$(MCU) --format=avr &quot;$(TARGET_OUTPUT_FILE)&quot;' />
- </ExtraCommands>
- <Environment>
- <Variable name="BOARD" value="Arduino Nano (168)" />
- <Variable name="BOARD_ID" value="nano168" />
- <Variable name="MCU" value="atmega168" />
- <Variable name="MCU_CLOCK" value="16" />
- <Variable name="UPLOAD_BAUDRATE" value="19200" />
- <Variable name="UPLOAD_PORT" value="" />
- </Environment>
- </Target>
- <Target title="Arduino Mini (328)">
- <Option output="bin/Release/obdlogger_${BOARD_ID}.elf" prefix_auto="1" extension_auto="0" />
- <Option type="1" />
- <Option compiler="avrgcc" />
- <Compiler>
- <Add option="-x c++" />
- <Add option="-mmcu=$(MCU)" />
- <Add option="-DF_CPU=16000000L" />
- <Add option="-D__AVR_ATmega328P__" />
- <Add option="-Os" />
- <Add directory="$(ARDUINO_DIR)/hardware/arduino/cores/arduino" />
- <Add directory="$(ARDUINO_DIR)/libraries" />
- <Add directory="$(ARDUINO_DIR)/hardware/arduino/variants/eightanaloginputs" />
- </Compiler>
- <Linker>
- <Add option="-mmcu=$(MCU)" />
- <Add option='&quot;$(PROJECT_DIR)bin/lib_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- <Add option='&quot;$(PROJECT_DIR)bin/core_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- </Linker>
- <ExtraCommands>
- <Add before='$(TARGET_COMPILER_DIR)ArduinoUploader &quot;$(PROJECT_DIR).&quot; $(BOARD_ID) - $(MCU_CLOCK) 0 &quot;$(PROJECT_DIR)bin/lib_${BOARD_ID}_${MCU_CLOCK}.a&quot; &quot;$(PROJECT_DIR)bin/core_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- <Add after='avr-objcopy -O ihex -R .eeprom -R .eesafe &quot;$(TARGET_OUTPUT_FILE)&quot; &quot;$(TARGET_OUTPUT_FILE).hex&quot;' />
- <Add after='avr-objcopy --no-change-warnings -j .eeprom --change-section-lma .eeprom=0 -O ihex &quot;$(TARGET_OUTPUT_FILE)&quot; &quot;$(TARGET_OUTPUT_FILE).eep.hex&quot;' />
- <Add after='avr-size --mcu=$(MCU) --format=avr &quot;$(TARGET_OUTPUT_FILE)&quot;' />
- </ExtraCommands>
- <Environment>
- <Variable name="BOARD" value="Arduino Mini (328)" />
- <Variable name="BOARD_ID" value="mini328" />
- <Variable name="MCU" value="atmega328p" />
- <Variable name="MCU_CLOCK" value="16" />
- <Variable name="UPLOAD_BAUDRATE" value="57600" />
- <Variable name="UPLOAD_PORT" value="" />
- </Environment>
- </Target>
- <Target title="Arduino Mini (168)">
- <Option output="bin/Release/obdlogger_${BOARD_ID}.elf" prefix_auto="1" extension_auto="0" />
- <Option type="1" />
- <Option compiler="avrgcc" />
- <Compiler>
- <Add option="-x c++" />
- <Add option="-mmcu=$(MCU)" />
- <Add option="-DF_CPU=16000000L" />
- <Add option="-D__AVR_ATmega168__" />
- <Add option="-Os" />
- <Add directory="$(ARDUINO_DIR)/hardware/arduino/cores/arduino" />
- <Add directory="$(ARDUINO_DIR)/libraries" />
- <Add directory="$(ARDUINO_DIR)/hardware/arduino/variants/eightanaloginputs" />
- </Compiler>
- <Linker>
- <Add option="-mmcu=$(MCU)" />
- <Add option='&quot;$(PROJECT_DIR)bin/lib_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- <Add option='&quot;$(PROJECT_DIR)bin/core_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- </Linker>
- <ExtraCommands>
- <Add before='$(TARGET_COMPILER_DIR)ArduinoUploader &quot;$(PROJECT_DIR).&quot; $(BOARD_ID) - $(MCU_CLOCK) 0 &quot;$(PROJECT_DIR)bin/lib_${BOARD_ID}_${MCU_CLOCK}.a&quot; &quot;$(PROJECT_DIR)bin/core_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- <Add after='avr-objcopy -O ihex -R .eeprom -R .eesafe &quot;$(TARGET_OUTPUT_FILE)&quot; &quot;$(TARGET_OUTPUT_FILE).hex&quot;' />
- <Add after='avr-objcopy --no-change-warnings -j .eeprom --change-section-lma .eeprom=0 -O ihex &quot;$(TARGET_OUTPUT_FILE)&quot; &quot;$(TARGET_OUTPUT_FILE).eep.hex&quot;' />
- <Add after='avr-size --mcu=$(MCU) --format=avr &quot;$(TARGET_OUTPUT_FILE)&quot;' />
- </ExtraCommands>
- <Environment>
- <Variable name="BOARD" value="Arduino Mini (168)" />
- <Variable name="BOARD_ID" value="mini168" />
- <Variable name="MCU" value="atmega168" />
- <Variable name="MCU_CLOCK" value="16" />
- <Variable name="UPLOAD_BAUDRATE" value="19200" />
- <Variable name="UPLOAD_PORT" value="" />
- </Environment>
- </Target>
- <Target title="Arduino Pro Mini (328)">
- <Option output="bin/Release/obdlogger_${BOARD_ID}.elf" prefix_auto="1" extension_auto="0" />
- <Option type="1" />
- <Option compiler="avrgcc" />
- <Compiler>
- <Add option="-x c++" />
- <Add option="-mmcu=$(MCU)" />
- <Add option="-DF_CPU=16000000L" />
- <Add option="-D__AVR_ATmega328P__" />
- <Add option="-Os" />
- <Add directory="$(ARDUINO_DIR)/hardware/arduino/cores/arduino" />
- <Add directory="$(ARDUINO_DIR)/libraries" />
- <Add directory="$(ARDUINO_DIR)/hardware/arduino/variants/standard" />
- </Compiler>
- <Linker>
- <Add option="-mmcu=$(MCU)" />
- <Add option='&quot;$(PROJECT_DIR)bin/lib_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- <Add option='&quot;$(PROJECT_DIR)bin/core_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- </Linker>
- <ExtraCommands>
- <Add before='$(TARGET_COMPILER_DIR)ArduinoUploader &quot;$(PROJECT_DIR).&quot; $(BOARD_ID) - $(MCU_CLOCK) 0 &quot;$(PROJECT_DIR)bin/lib_${BOARD_ID}_${MCU_CLOCK}.a&quot; &quot;$(PROJECT_DIR)bin/core_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- <Add after='avr-objcopy -O ihex -R .eeprom -R .eesafe &quot;$(TARGET_OUTPUT_FILE)&quot; &quot;$(TARGET_OUTPUT_FILE).hex&quot;' />
- <Add after='avr-objcopy --no-change-warnings -j .eeprom --change-section-lma .eeprom=0 -O ihex &quot;$(TARGET_OUTPUT_FILE)&quot; &quot;$(TARGET_OUTPUT_FILE).eep.hex&quot;' />
- <Add after='avr-size --mcu=$(MCU) --format=avr &quot;$(TARGET_OUTPUT_FILE)&quot;' />
- </ExtraCommands>
- <Environment>
- <Variable name="BOARD" value="Arduino Pro Mini (328)" />
- <Variable name="BOARD_ID" value="promini328" />
- <Variable name="MCU" value="atmega328p" />
- <Variable name="MCU_CLOCK" value="16" />
- <Variable name="UPLOAD_BAUDRATE" value="57600" />
- <Variable name="UPLOAD_PORT" value="" />
- </Environment>
- </Target>
- <Target title="Arduino Pro Mini (168)">
- <Option output="bin/Release/obdlogger_${BOARD_ID}.elf" prefix_auto="1" extension_auto="0" />
- <Option type="1" />
- <Option compiler="avrgcc" />
- <Compiler>
- <Add option="-x c++" />
- <Add option="-mmcu=$(MCU)" />
- <Add option="-DF_CPU=16000000L" />
- <Add option="-D__AVR_ATmega168__" />
- <Add option="-Os" />
- <Add directory="$(ARDUINO_DIR)/hardware/arduino/cores/arduino" />
- <Add directory="$(ARDUINO_DIR)/libraries" />
- <Add directory="$(ARDUINO_DIR)/hardware/arduino/variants/standard" />
- </Compiler>
- <Linker>
- <Add option="-mmcu=$(MCU)" />
- <Add option='&quot;$(PROJECT_DIR)bin/lib_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- <Add option='&quot;$(PROJECT_DIR)bin/core_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- </Linker>
- <ExtraCommands>
- <Add before='$(TARGET_COMPILER_DIR)ArduinoUploader &quot;$(PROJECT_DIR).&quot; $(BOARD_ID) - $(MCU_CLOCK) 0 &quot;$(PROJECT_DIR)bin/lib_${BOARD_ID}_${MCU_CLOCK}.a&quot; &quot;$(PROJECT_DIR)bin/core_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- <Add after='avr-objcopy -O ihex -R .eeprom -R .eesafe &quot;$(TARGET_OUTPUT_FILE)&quot; &quot;$(TARGET_OUTPUT_FILE).hex&quot;' />
- <Add after='avr-objcopy --no-change-warnings -j .eeprom --change-section-lma .eeprom=0 -O ihex &quot;$(TARGET_OUTPUT_FILE)&quot; &quot;$(TARGET_OUTPUT_FILE).eep.hex&quot;' />
- <Add after='avr-size --mcu=$(MCU) --format=avr &quot;$(TARGET_OUTPUT_FILE)&quot;' />
- </ExtraCommands>
- <Environment>
- <Variable name="BOARD" value="Arduino Pro Mini (168)" />
- <Variable name="BOARD_ID" value="promini168" />
- <Variable name="MCU" value="atmega168" />
- <Variable name="MCU_CLOCK" value="16" />
- <Variable name="UPLOAD_BAUDRATE" value="19200" />
- <Variable name="UPLOAD_PORT" value="" />
- </Environment>
- </Target>
- <Target title="Arduino Mega 2560/ADK">
- <Option output="bin/Release/obdlogger_${BOARD_ID}.elf" prefix_auto="1" extension_auto="0" />
- <Option type="1" />
- <Option compiler="avrgcc" />
- <Compiler>
- <Add option="-O3" />
- <Add option="-x c++" />
- <Add option="-mmcu=$(MCU)" />
- <Add option="-DF_CPU=16000000L" />
- <Add option="-D__AVR_ATmega2560__" />
- <Add directory="$(ARDUINO_DIR)/hardware/arduino/cores/arduino" />
- <Add directory="$(ARDUINO_DIR)/libraries" />
- <Add directory="$(ARDUINO_DIR)/hardware/arduino/variants/mega" />
- </Compiler>
- <Linker>
- <Add option="-mmcu=$(MCU)" />
- <Add option='&quot;$(PROJECT_DIR)bin/lib_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- <Add option='&quot;$(PROJECT_DIR)bin/core_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- </Linker>
- <ExtraCommands>
- <Add before='$(TARGET_COMPILER_DIR)ArduinoUploader &quot;$(PROJECT_DIR).&quot; $(BOARD_ID) - $(MCU_CLOCK) 0 &quot;$(PROJECT_DIR)bin/lib_${BOARD_ID}_${MCU_CLOCK}.a&quot; &quot;$(PROJECT_DIR)bin/core_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- <Add after='avr-objcopy -O ihex -R .eeprom -R .eesafe &quot;$(TARGET_OUTPUT_FILE)&quot; &quot;$(TARGET_OUTPUT_FILE).hex&quot;' />
- <Add after='avr-objcopy --no-change-warnings -j .eeprom --change-section-lma .eeprom=0 -O ihex &quot;$(TARGET_OUTPUT_FILE)&quot; &quot;$(TARGET_OUTPUT_FILE).eep.hex&quot;' />
- <Add after='avr-size --mcu=$(MCU) --format=avr &quot;$(TARGET_OUTPUT_FILE)&quot;' />
- </ExtraCommands>
- <Environment>
- <Variable name="BOARD" value="Arduino Mega 2560\ADK" />
- <Variable name="BOARD_ID" value="mega2560" />
- <Variable name="MCU" value="atmega2560" />
- <Variable name="MCU_CLOCK" value="16" />
- <Variable name="UPLOAD_BAUDRATE" value="115200" />
- <Variable name="UPLOAD_PORT" value="COM37" />
- </Environment>
- </Target>
- <Target title="Arduino Mega 1280">
- <Option output="bin/Release/obdlogger_${BOARD_ID}.elf" prefix_auto="1" extension_auto="0" />
- <Option type="1" />
- <Option compiler="avrgcc" />
- <Compiler>
- <Add option="-x c++" />
- <Add option="-mmcu=$(MCU)" />
- <Add option="-DF_CPU=16000000L" />
- <Add option="-D__AVR_ATmega1280__" />
- <Add option="-O2" />
- <Add directory="$(ARDUINO_DIR)/hardware/arduino/cores/arduino" />
- <Add directory="$(ARDUINO_DIR)/libraries" />
- <Add directory="$(ARDUINO_DIR)/hardware/arduino/variants/mega" />
- </Compiler>
- <Linker>
- <Add option="-mmcu=$(MCU)" />
- <Add option='&quot;$(PROJECT_DIR)bin/lib_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- <Add option='&quot;$(PROJECT_DIR)bin/core_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- </Linker>
- <ExtraCommands>
- <Add before='$(TARGET_COMPILER_DIR)ArduinoUploader &quot;$(PROJECT_DIR).&quot; $(BOARD_ID) - $(MCU_CLOCK) 0 &quot;$(PROJECT_DIR)bin/lib_${BOARD_ID}_${MCU_CLOCK}.a&quot; &quot;$(PROJECT_DIR)bin/core_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- <Add after='avr-objcopy -O ihex -R .eeprom -R .eesafe &quot;$(TARGET_OUTPUT_FILE)&quot; &quot;$(TARGET_OUTPUT_FILE).hex&quot;' />
- <Add after='avr-objcopy --no-change-warnings -j .eeprom --change-section-lma .eeprom=0 -O ihex &quot;$(TARGET_OUTPUT_FILE)&quot; &quot;$(TARGET_OUTPUT_FILE).eep.hex&quot;' />
- <Add after='avr-size --mcu=$(MCU) --format=avr &quot;$(TARGET_OUTPUT_FILE)&quot;' />
- </ExtraCommands>
- <Environment>
- <Variable name="BOARD" value="Arduino Mega 1280" />
- <Variable name="BOARD_ID" value="mega1280" />
- <Variable name="MCU" value="atmega1280" />
- <Variable name="MCU_CLOCK" value="16" />
- <Variable name="UPLOAD_BAUDRATE" value="57600" />
- <Variable name="UPLOAD_PORT" value="" />
- </Environment>
- </Target>
- <Target title="Arduino Mega 8">
- <Option output="bin/Release/obdlogger_${BOARD_ID}.elf" prefix_auto="1" extension_auto="0" />
- <Option type="1" />
- <Option compiler="avrgcc" />
- <Compiler>
- <Add option="-x c++" />
- <Add option="-mmcu=$(MCU)" />
- <Add option="-DF_CPU=16000000L" />
- <Add option="-D__AVR_ATmega328P__" />
- <Add option="-Os" />
- <Add directory="$(ARDUINO_DIR)/hardware/arduino/cores/arduino" />
- <Add directory="$(ARDUINO_DIR)/libraries" />
- <Add directory="$(ARDUINO_DIR)/hardware/arduino/variants/standard" />
- </Compiler>
- <Linker>
- <Add option="-mmcu=$(MCU)" />
- <Add option='&quot;$(PROJECT_DIR)bin/lib_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- <Add option='&quot;$(PROJECT_DIR)bin/core_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- </Linker>
- <ExtraCommands>
- <Add before='$(TARGET_COMPILER_DIR)ArduinoUploader &quot;$(PROJECT_DIR).&quot; $(BOARD_ID) - $(MCU_CLOCK) 0 &quot;$(PROJECT_DIR)bin/lib_${BOARD_ID}_${MCU_CLOCK}.a&quot; &quot;$(PROJECT_DIR)bin/core_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- <Add after='avr-objcopy -O ihex -R .eeprom -R .eesafe &quot;$(TARGET_OUTPUT_FILE)&quot; &quot;$(TARGET_OUTPUT_FILE).hex&quot;' />
- <Add after='avr-objcopy --no-change-warnings -j .eeprom --change-section-lma .eeprom=0 -O ihex &quot;$(TARGET_OUTPUT_FILE)&quot; &quot;$(TARGET_OUTPUT_FILE).eep.hex&quot;' />
- <Add after='avr-size --mcu=$(MCU) --format=avr &quot;$(TARGET_OUTPUT_FILE)&quot;' />
- </ExtraCommands>
- <Environment>
- <Variable name="BOARD" value="Arduino Mega 8" />
- <Variable name="BOARD_ID" value="mega8" />
- <Variable name="MCU" value="atmega8" />
- <Variable name="MCU_CLOCK" value="16" />
- <Variable name="UPLOAD_BAUDRATE" value="19200" />
- <Variable name="UPLOAD_PORT" value="" />
- </Environment>
- </Target>
- <Target title="Microduino Core+ (644P)">
- <Option output="bin/Release/obdlogger_${BOARD_ID}.elf" prefix_auto="1" extension_auto="0" />
- <Option type="1" />
- <Option compiler="avrgcc" />
- <Compiler>
- <Add option="-O3" />
- <Add option="-x c++" />
- <Add option="-mmcu=$(MCU)" />
- <Add option="-DF_CPU=16000000L" />
- <Add option="-D__AVR_ATmega644P__" />
- <Add directory="$(ARDUINO_DIR)/hardware/arduino/cores/arduino" />
- <Add directory="$(ARDUINO_DIR)/libraries" />
- <Add directory="$(ARDUINO_DIR)/hardware/arduino/variants/plus" />
- </Compiler>
- <Linker>
- <Add option="-mmcu=$(MCU)" />
- <Add option='&quot;$(PROJECT_DIR)bin/lib_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- <Add option='&quot;$(PROJECT_DIR)bin/core_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- </Linker>
- <ExtraCommands>
- <Add before='$(TARGET_COMPILER_DIR)ArduinoUploader &quot;$(PROJECT_DIR).&quot; $(BOARD_ID) - $(MCU_CLOCK) 0 &quot;$(PROJECT_DIR)bin/lib_${BOARD_ID}_${MCU_CLOCK}.a&quot; &quot;$(PROJECT_DIR)bin/core_${BOARD_ID}_${MCU_CLOCK}.a&quot;' />
- <Add after='avr-objcopy -O ihex -R .eeprom -R .eesafe &quot;$(TARGET_OUTPUT_FILE)&quot; &quot;$(TARGET_OUTPUT_FILE).hex&quot;' />
- <Add after='avr-objcopy --no-change-warnings -j .eeprom --change-section-lma .eeprom=0 -O ihex &quot;$(TARGET_OUTPUT_FILE)&quot; &quot;$(TARGET_OUTPUT_FILE).eep.hex&quot;' />
- <Add after='avr-size --mcu=$(MCU) --format=avr &quot;$(TARGET_OUTPUT_FILE)&quot;' />
- </ExtraCommands>
- <Environment>
- <Variable name="BOARD" value="Microduino Core+ (644P)" />
- <Variable name="BOARD_ID" value="uduino644p" />
- <Variable name="MCU" value="atmega644p" />
- <Variable name="MCU_CLOCK" value="16" />
- <Variable name="UPLOAD_BAUDRATE" value="115200" />
- <Variable name="UPLOAD_PORT" value="" />
- </Environment>
- </Target>
- </Build>
- <Compiler>
- <Add directory="." />
- </Compiler>
- <Unit filename="config.h" />
- <Unit filename="datalogger.h" />
- <Unit filename="images.h" />
- <Unit filename="pbox.ino">
- <Option compile="1" />
- <Option link="1" />
- </Unit>
- <Extensions>
- <code_completion />
- <debugger />
- <envvars />
- </Extensions>
- </Project>
-</CodeBlocks_project_file>
diff --git a/nanotimer/nanotimer.ino b/nanotimer/nanotimer.ino
index 7b47f70..b9e20b9 100644
--- a/nanotimer/nanotimer.ino
+++ b/nanotimer/nanotimer.ino
@@ -43,7 +43,11 @@ static byte stage = STAGE_IDLE;
static uint16_t times[4] = {0};
+#if ENABLE_DATA_LOG
class COBDLogger : public COBD, public CDataLogger
+#else
+class COBDLogger : public COBD
+#endif
{
public:
COBDLogger():state(0) {}
@@ -180,12 +184,15 @@ private:
{
uint32_t elapsed = millis() - startTime;
uint16_t n;
-
+#if !ENABLE_DATA_LOG
+ uint32_t dataTime;
+#endif
int speed;
if (!read(PID_SPEED, speed))
return;
dataTime = millis();
+#if ENABLE_DATA_LOG
logData(0x100 | PID_SPEED, speed);
int rpm = 0;
@@ -193,6 +200,7 @@ private:
dataTime = millis();
logData(0x100 | PID_RPM, rpm);
}
+#endif
lcd.setFontSize(FONT_SIZE_XLARGE);
// estimate distance
@@ -211,11 +219,13 @@ private:
stage = STAGE_MEASURING;
startTime = lastSpeedTime;
+#if ENABLE_DATA_LOG
uint32_t t = dataTime;
dataTime = lastSpeedTime;
logData(0x100 | PID_SPEED, lastSpeed);
dataTime = t;
logData(0x100 | PID_SPEED, speed);
+#endif
lastSpeed = 0;
distance = 0;
@@ -267,6 +277,7 @@ private:
lcd.printInt(distance, 3);
}
}
+#if ENABLE_DATA_LOG
// log speed data
logData(0x100 | PID_SPEED, speed);
// log additional data
@@ -275,6 +286,7 @@ private:
dataTime = millis();
logData(0x100 | PID_RPM, rpm);
}
+#endif
} else {
if (speed == 0) {
stage = STAGE_WAIT_START;
@@ -380,9 +392,8 @@ void setup()
lcd.println("PerformanceBox");
logger.begin();
- logger.initSender();
-
#if ENABLE_DATA_LOG
+ logger.initSender();
logger.checkSD();
#endif
logger.setup();