Skip to content

Commit 1d700a4

Browse files
committed
version numbering fix
1 parent da56876 commit 1d700a4

3 files changed

Lines changed: 21 additions & 18 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- name: Run PlatformIO Build
3636
run: pio run -d Sources -e release
3737
env:
38-
PLATFORMIO_BUILD_FLAGS: "-DVERSION_MAJOR=${{ steps.tag.outputs.major }} -DVERSION_MINOR=${{ steps.tag.outputs.minor }} -DVERSION_PATCH=${{ steps.tag.outputs.patch }}"
38+
PLATFORMIO_BUILD_FLAGS: "-DVERSION_MAJOR=\"${{ steps.tag.outputs.major }}\" -DVERSION_MINOR=\"${{ steps.tag.outputs.minor }}\" -DVERSION_PATCH=\"${{ steps.tag.outputs.patch }}\""
3939

4040
- name: Create Release
4141
id: create_release

Sources/platformio.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ board_build.f_cpu = 48000000L
1010
board_build.use_builtin_debug_code = no
1111

1212
[env:debug]
13-
build_flags = ${env.build_flags} -DDEBUG=2 -DVERSION_MAJOR="255" -DVERSION_MINOR="255" -DVERSION_PATCH="255"
13+
build_flags = ${env.build_flags} -DDEBUG=2 -DVERSION_MAJOR=\"255\" -DVERSION_MINOR=\"255\" -DVERSION_PATCH=\"255\"
1414

1515
[env:release]

Sources/src/main.c

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -113,19 +113,19 @@ typedef struct
113113
/*
114114
* This struct contains all data that is available through I2C.
115115
* Use the following command with a Buspirate to test:
116-
* read version number : [ 0x84 0x00 [ 0x85 r:3 ]
117-
* read key report : [ 0x84 0x03 [ 0x85 r:8 ]
118-
* read output : [ 0x84 0x0b [ 0x85 r:1 ]
119-
* read backlight : [ 0x84 0x0c [ 0x85 r:2 ]
120-
* turn off backlight : [ 0x84 0x0c 0x00 0x00 ]
121-
* turn on backlight : [ 0x84 0x0c 0x64 0x00 ]
122-
* read RGB led : [ 0x84 0x0e [ 0x85 r:3 ]
123-
* turn off RGB led : [ 0x84 0x0e 0x00:3 ]
124-
* turn on RGB led : [ 0x84 0x0e 0xFF:3 ]
125-
* turn on RGB led : [ 0x84 0x0e 0xFF 0x00 0x00 ]
126-
* turn on caps led : [ 0x84 0x11 0xFF ]
127-
* turn off caps led : [ 0x84 0x11 0x00 ]
128-
* read caps led: [ 0x84 0x11 [ 0x85 r ]
116+
* read version number : [ 0x70 0x00 [ 0x71 r:3 ]
117+
* read key report : [ 0x70 0x03 [ 0x71 r:8 ]
118+
* read output : [ 0x70 0x0b [ 0x71 r:1 ]
119+
* read backlight : [ 0x70 0x0c [ 0x71 r:2 ]
120+
* turn off backlight : [ 0x70 0x0c 0x00 0x00 ]
121+
* turn on backlight : [ 0x70 0x0c 0x64 0x00 ]
122+
* read RGB led : [ 0x70 0x0e [ 0x71 r:3 ]
123+
* turn off RGB led : [ 0x70 0x0e 0x00:3 ]
124+
* turn on RGB led : [ 0x70 0x0e 0xFF:3 ]
125+
* turn on RGB led : [ 0x70 0x0e 0xFF 0x00 0x00 ]
126+
* turn on caps led : [ 0x70 0x11 0xFF ]
127+
* turn off caps led : [ 0x70 0x11 0x00 ]
128+
* read caps led: [ 0x70 0x11 [ 0x71 r ]
129129
*/
130130
typedef struct __attribute__((packed))
131131
{
@@ -1057,9 +1057,12 @@ int main(void)
10571057
memset(&state, 0, sizeof(addon_state_t));
10581058

10591059
/* set the version number from git */
1060-
state.data.version[0] = atoi(VERSION_MAJOR) & 0xff;
1061-
state.data.version[1] = atoi(VERSION_MINOR) & 0xff;
1062-
state.data.version[2] = atoi(VERSION_PATCH) & 0xff;
1060+
char version_major[] = VERSION_MAJOR;
1061+
char version_minor[] = VERSION_MINOR;
1062+
char version_patch[] = VERSION_PATCH;
1063+
state.data.version[0] = atoi(version_major) & 0xff;
1064+
state.data.version[1] = atoi(version_minor) & 0xff;
1065+
state.data.version[2] = atoi(version_patch) & 0xff;
10631066

10641067
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1);
10651068
SystemCoreClockUpdate();

0 commit comments

Comments
 (0)