Skip to content

Commit

Permalink
Merge pull request #227: Issue 225: Support Nano Every with Atmega4808
Browse files Browse the repository at this point in the history
  • Loading branch information
boerge1 authored Sep 5, 2024
2 parents 2bfcf6e + 7620320 commit ec89ae5
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 14 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ Die SD Karte (Ordner mp3 und advert) hat sich gegenüber der Version 3.1.11 geä

# Change Log

## Version 3.2.0 (23.08.2024)
- [Issue 225](https://github.com/tonuino/TonUINO-TNG/issues/225): Support Nano Every with Atmega4808

## Version 3.1.12 (22.08.2024)
- [Issue 222](https://github.com/tonuino/TonUINO-TNG/issues/222): Fix bug: TB modification card ends active game modification card
- [Issue 220](https://github.com/tonuino/TonUINO-TNG/issues/220): New shortcut for switching BT on/off
Expand Down
5 changes: 4 additions & 1 deletion TonUINO-TNG.ino
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,17 @@ void setup()
LOG(init_log, s_error, F("TonUINO Version 3.1 - refactored by Boerge1\n"));
LOG(init_log, s_error, F("created by Thorsten Voß and licensed under GNU/GPL."));
LOG(init_log, s_error, F("Information and contribution at https://tonuino.de.\n"));
LOG(init_log, s_error, F("V3.1.12 22.08.24\n"));
LOG(init_log, s_error, F("V3.2.0 23.08.24\n"));

#ifdef TonUINO_Classic
LOG(init_log, s_error, F("C "), lf_no);
#endif
#ifdef TonUINO_Every
LOG(init_log, s_error, F("E "), lf_no);
#endif
#ifdef TonUINO_Every_4808
LOG(init_log, s_error, F("EC "), lf_no);
#endif
#ifdef ALLinONE
LOG(init_log, s_error, F("A "), lf_no);
#endif
Expand Down
55 changes: 46 additions & 9 deletions platformio.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
; ###### common env #####################################

[env]
lib_deps =
Expand All @@ -22,6 +14,8 @@ build_unflags =
-std=gnu++11
framework = arduino

; ###### Classic ########################################

[env:TonUINO_Classic_3]
platform = atmelavr
board = nanoatmega328
Expand Down Expand Up @@ -54,6 +48,8 @@ build_flags =

monitor_speed = 115200

; ###### Classic with Every #############################

[env:TonUINO_Every_3]
platform = atmelmegaavr
board = nano_every
Expand Down Expand Up @@ -86,6 +82,45 @@ build_flags =

monitor_speed = 115200

; ###### Classic with Every 4808 #########################

[env:TonUINO_Every4808_3]
platform = atmelmegaavr
board = ATmega4808
board_build.variant = nano-4808

build_flags =
${env.build_flags}
-D TonUINO_Every_4808=1

monitor_speed = 115200

[env:TonUINO_Every4808_5]
platform = atmelmegaavr
board = ATmega4808
board_build.variant = nano-4808

build_flags =
${env.build_flags}
-D TonUINO_Every_4808=1
-D FIVEBUTTONS=1

monitor_speed = 115200

[env:TonUINO_Every4808_3x3]
platform = atmelmegaavr
board = ATmega4808
board_build.variant = nano-4808

build_flags =
${env.build_flags}
-D TonUINO_Every_4808=1
-D BUTTONS3X3=1

monitor_speed = 115200

; ###### All in One ######################################

[env:ALLinONE_3]
platform = lgt8f
board = LGT8F328P
Expand Down Expand Up @@ -130,6 +165,8 @@ build_flags =

monitor_speed = 115200

; ###### All in One Plus #################################

[env:ALLinONE_Plus_3]
platform = atmelmegaavr
board = ATmega4809
Expand Down
3 changes: 3 additions & 0 deletions src/buttons3x3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ class Buttons3x3: public CommandSource {
#ifdef TonUINO_Every
static constexpr int16_t maxLevel = 900; // 1023
#endif
#ifdef TonUINO_Every_4808
static constexpr int16_t maxLevel = 900; // 1023
#endif
#ifdef ALLinONE
static constexpr int16_t maxLevel = 4300; // 4064;
#endif
Expand Down
8 changes: 6 additions & 2 deletions src/constants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
*/
//#define TonUINO_Classic
//#define TonUINO_Every
//#define TonUINO_Every_4808
//#define ALLinONE
//#define ALLinONE_Plus

Expand Down Expand Up @@ -304,6 +305,9 @@ inline constexpr float voltageMeasurementCorrection = 1.960; // Spannungsteil
#ifdef TonUINO_Every
inline constexpr float voltageMeasurementCorrection = 2.007; // Spannungsteiler 100k/100k
#endif
#ifdef TonUINO_Every_4808
inline constexpr float voltageMeasurementCorrection = 2.007; // Spannungsteiler 100k/100k
#endif

inline constexpr float batVoltageLow = 2.95;
inline constexpr float batVoltageEmpty = 2.90;
Expand Down Expand Up @@ -339,7 +343,7 @@ inline constexpr uint32_t buttonLongPressRepeat = 200; // timeout for long pre
** Classic ****************************************************************
***************************************************************************/

#if defined(TonUINO_Classic) or defined(TonUINO_Every)
#if defined(TonUINO_Classic) or defined(TonUINO_Every) or defined(TonUINO_Every_4808)
// ####### buttons #####################################

inline constexpr uint8_t buttonPausePin = A0;
Expand Down Expand Up @@ -400,7 +404,7 @@ inline constexpr levelType shutdownPinType = levelType::activeLow;
#endif
inline constexpr uint8_t openAnalogPin = A7;
inline constexpr unsigned long cycleTime = 50;
#endif /* TonUINO_Classic or TonUINO_Every */
#endif /* TonUINO_Classic or TonUINO_Every or TonUINO_Every_4808 */

/***************************************************************************
** AiO plus ***************************************************************
Expand Down
2 changes: 1 addition & 1 deletion src/rotary_encoder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "commands.hpp"
#include "timer.hpp"

#if not defined(ALLinONE_Plus) and not defined(TonUINO_Every)
#if not defined(ALLinONE_Plus) and not defined(TonUINO_Every) and not defined(TonUINO_Every_4808)
#define USE_TIMER1
#define ROTARY_ENCODER_USES_TIMER1
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/tonuino.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void Tonuino::setup() {
#endif

#if defined(BUTTONS3X3) or defined(BAT_VOLTAGE_MEASUREMENT)
#if defined(ALLinONE_Plus) or defined(TonUINO_Every)
#if defined(ALLinONE_Plus) or defined(TonUINO_Every) or defined(TonUINO_Every_4808)
analogReference(INTERNAL2V5);
#endif
#ifdef ALLinONE
Expand Down

0 comments on commit ec89ae5

Please sign in to comment.