From 8289c1863e9f0672ec250c71fb2b1c8536869d02 Mon Sep 17 00:00:00 2001 From: Lucas <10280695+Lukelectro@users.noreply.github.com> Date: Wed, 28 Jan 2026 21:20:31 +0100 Subject: [PATCH 1/3] platformio ini changed, now compiles for 50228 but not for others yet, in platformio, under windows. NOTE: it might be less frustrating to use a text editor and Make in Linux, as Makefiles are ignored by platformio and the atmega161 is not supported in Arduino anyway --- platformio.ini | 57 +++++++++++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 21 deletions(-) diff --git a/platformio.ini b/platformio.ini index 573fd82..82b4374 100644 --- a/platformio.ini +++ b/platformio.ini @@ -1,29 +1,44 @@ -[env:the_latest_version] +[platformio] +include_dir = ${PROJECT_DIR}/shared +src_dir = ${PROJECT_DIR}/. +default_envs = 50228, 50229 + +[env:50228] ;50228 board +build_src_filter = + -<*> + +<50228/*.c> + + platform = atmelavr +board_build.mcu = atmega161 +board_build.f_cpu = 8000000L +;board = ATmega161 ; unknown board +;framework = arduino ; // arduino does not support Atmega161 +framework = ; leeg, want geen arduino -[env:exact_version] -platform = atmelavr@1.2.3 +build_flags = -g -Wall -O3 -std=gnu99 -I 50228 -I shared -Wl,-Map=disp.map -# Semantic Versioning Rules -[env:specific_major_version] -# any compatible version (exact version for 1.x.x versions) -platform = atmelavr@^1.2.3 -[env:specific_major_and_minor_version] -# any version with the same major and minor versions, and an equal or greater patch version -platform = atmelavr@~1.2.3 - -[env:development_verion_by_git] -platform = https://github.com/platformio/platform-atmelavr.git - -[env:custom_git_branch] -platform = https://github.com/platformio/platform-atmelavr.git#custom-branch +[env:50229] ; 50229 board can have a Atmega161 or Atmega162 +build_src_filter = + +<50229/*.c> + + +platform = atmelavr +board_build.mcu = atmega162 +board_build.f_cpu = 8000000L +board = ATmega162 +framework = arduino +build_flags = -g -Wall -O3 -std=gnu99 -I 50229 -I shared -Wl,-Map=disp.map -[env:specific_git_commit] -platform = https://github.com/platformio/platform-atmelavr.git#1234567890abcdef -[env:ATmega161] +[env:50227] +build_src_filter = + +<50227/*.c> + + platform = atmelavr -board = ATmega161 -framework = arduino +board_build.mcu = atmega161 +board_build.f_cpu = 8000000L +;board = ATmega161 ; unknown board +;framework = arduino ; // arduino does not support Atmega161 +framework = ; leeg, want geen arduino +build_flags = -g -Wall -O3 -std=gnu99 -I 50227 -I shared -Wl,-Map=disp.map \ No newline at end of file From f742fab48766514a46f5e6e6ed0a6aabb14f7aca Mon Sep 17 00:00:00 2001 From: Lucas <10280695+Lukelectro@users.noreply.github.com> Date: Wed, 28 Jan 2026 22:41:56 +0100 Subject: [PATCH 2/3] removed stray character causing it not to compile --- 50227/buttons50227.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/50227/buttons50227.c b/50227/buttons50227.c index 07cde60..0542a4c 100644 --- a/50227/buttons50227.c +++ b/50227/buttons50227.c @@ -133,7 +133,7 @@ unsigned char butt_scan() const char * butt_scan2label(unsigned char at) { static const char *_labels[KEY_ROWS][KEY_COLS] = { - { "18R", "18L", "09", i "HELI", }, + { "18R", "18L", "09", "HELI", }, { "L1", "36L", "36R", "27", }, { "R2", "R1", "18C", "24", }, { "04", "R3", "L2", "36C" }, From 5c44598084509af2bfb92f00ad698e4d08a9dae7 Mon Sep 17 00:00:00 2001 From: Lucas <10280695+Lukelectro@users.noreply.github.com> Date: Thu, 29 Jan 2026 13:09:09 +0100 Subject: [PATCH 3/3] with this platformio.ini it compiles on Windows. Upload does not work yet though, as builtin AVRdude has no USB / won't work with my usbasp or dragon_isp. --- platformio.ini | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/platformio.ini b/platformio.ini index 82b4374..0959334 100644 --- a/platformio.ini +++ b/platformio.ini @@ -1,7 +1,7 @@ [platformio] include_dir = ${PROJECT_DIR}/shared src_dir = ${PROJECT_DIR}/. -default_envs = 50228, 50229 +default_envs = 50228, 50229, 50227 [env:50228] ;50228 board build_src_filter = @@ -17,21 +17,36 @@ framework = ; leeg, want geen arduino build_flags = -g -Wall -O3 -std=gnu99 -I 50228 -I shared -Wl,-Map=disp.map +upload_protocol = custom +upload_port = usb + +upload_flags = + -C + $PROJECT_PACKAGES_DIR/tool-avrdude/avrdude.conf + -p + m161 + -c + avrispmkII + -v +upload_command = avrdude $UPLOAD_FLAGS -U flash:w:$SOURCE:i + [env:50229] ; 50229 board can have a Atmega161 or Atmega162 build_src_filter = + -<*> +<50229/*.c> + platform = atmelavr board_build.mcu = atmega162 board_build.f_cpu = 8000000L board = ATmega162 -framework = arduino +;framework = arduino ; do not use arduino framework, even though m162 is supported, else you get :(.text.startup+0x14e): undefined reference to `pd44_sendCtrl' errors build_flags = -g -Wall -O3 -std=gnu99 -I 50229 -I shared -Wl,-Map=disp.map [env:50227] build_src_filter = + -<*> +<50227/*.c> + platform = atmelavr