Skip to content
Snippets Groups Projects
Commit cd159faa authored by Michael DM Dryden's avatar Michael DM Dryden
Browse files

Backwards compatibility with <1.2.3 by overriding BOARD_VER_MICRO when making.

parent 7926e89b
Branches
Tags
1 merge request!3Develop
Pipeline #69 failed with stage
in 13 seconds
image: kalledk/docker-avr-toolchain
build:
1.2.3:
script:
- cd DSTAT
- make
artifacts:
name: "${CI_BUILD_NAME}_${CI_BUILD_REF_NAME}"
paths:
- DSTAT/*.hex
- DSTAT/dstat-firmware.hex
- DSTAT/dstat-firmware.elf
pre-1.2.3:
script:
- cd DSTAT
- make BOARD_VER_MICRO=0
artifacts:
name: "${CI_BUILD_NAME}_${CI_BUILD_REF_NAME}"
paths:
- DSTAT/dstat-firmware.hex
- DSTAT/dstat-firmware.elf
......@@ -48,6 +48,11 @@ AVRDUDE_DEV = x256a3u
AVRDUDE_PROG = avrispmkII
AVRDUDE_PORT = usb
# Board Settings
BOARD_VER_MAJOR = 1
BOARD_VER_MINOR = 2
BOARD_VER_MICRO = 3
# Application target name. Given with suffix .a for library and .elf for a
# standalone application.
TARGET = dstat-firmware.elf
......@@ -104,11 +109,14 @@ CFLAGS =
CPPFLAGS = \
-D BOARD=USER_BOARD \
-D IOPORT_XMEGA_COMPAT \
-D F_CPU=$(F_CPU)UL
-D F_CPU=$(F_CPU)UL \
-D BOARD_VER_MAJOR=$(BOARD_VER_MAJOR) \
-D BOARD_VER_MINOR=$(BOARD_VER_MINOR) \
-D BOARD_VER_MICRO=$(BOARD_VER_MICRO)
# Extra flags to use when linking
LDFLAGS = -Wl,-u,vfprintf -lprintf_flt -Wl,-u,vfscanf -lscanf_flt
# Pre- and post-build commands
PREBUILD_CMD =
POSTBUILD_CMD =
\ No newline at end of file
POSTBUILD_CMD =
......@@ -10,10 +10,6 @@
#include <ioport.h>
#define BOARD_VER_MAJOR 1
#define BOARD_VER_MINOR 2
#define BOARD_VER_MICRO 3
#if BOARD_VER_MAJOR >= 1 && BOARD_VER_MINOR >= 2 && BOARD_VER_MICRO >=3
#define BOARD_XOSC_HZ 12000000
#define BOARD_XOSC_TYPE XOSC_TYPE_XTAL
......
......@@ -13,6 +13,7 @@
#include <string.h>
#include <math.h>
#include <stdint.h>
#include "conf_board.h"
//Internal function declarations
int8_t command_handler(char command);
......@@ -69,8 +70,10 @@ int main(void){
cpu_irq_enable();
board_init();
ioport_set_pin_dir(LED1, IOPORT_DIR_OUTPUT);
ioport_set_pin_dir(LED2, IOPORT_DIR_OUTPUT);
#if BOARD_VER_MAJOR >= 1 && BOARD_VER_MINOR >= 2 && BOARD_VER_MICRO >=3
ioport_set_pin_dir(LED1, IOPORT_DIR_OUTPUT);
ioport_set_pin_dir(LED2, IOPORT_DIR_OUTPUT);
#endif
pot_init();
pmic_init();
......@@ -117,10 +120,14 @@ int main(void){
stdio_usb_enable();
program_loop:
ioport_set_pin_level(LED1, 1);
#if BOARD_VER_MAJOR >= 1 && BOARD_VER_MINOR >= 2 && BOARD_VER_MICRO >=3
ioport_set_pin_level(LED1, 1);
#endif
while(getchar() != '!');
printf ("C\r\n");
ioport_set_pin_level(LED1, 0);
#if BOARD_VER_MAJOR >= 1 && BOARD_VER_MINOR >= 2 && BOARD_VER_MICRO >=3
ioport_set_pin_level(LED1, 1);
#endif
command_handler(getchar());
goto program_loop;
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment