Skip to content

Commit 235150e

Browse files
committed
Added menu entry to disable the compatibility. Removed useless typedef and added warning
1 parent 6534754 commit 235150e

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

boards.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,8 @@ uno2018.build.core=arduino
2020
uno2018.build.variant=uno2018
2121
#uno2018.build.extra_flags=-B{runtime.tools.atpack.path}/gcc/dev/{build.mcu}
2222

23+
menu.mode=Registers emulation
24+
uno2018.menu.mode.on=ATMEGA328
25+
uno2018.menu.mode.on.build.extra_flags=-DUNO_WIFI_REV2_328MODE
26+
uno2018.menu.mode.off=None (ATMEGA4809)
2327
##############################################################

cores/arduino/Arduino.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ bool isDoubleBondedActive(uint8_t pin);
142142
#include "USBCore.h"
143143
#include "CDC.h"
144144
#include "MSC.h"
145+
#ifdef UNO_WIFI_REV2_328MODE
145146
#include <UNO_compat.h>
147+
#endif
146148
#if defined(HAVE_HWSERIAL0) && defined(HAVE_CDCSERIAL)
147149
#error "Targets with both UART0 and CDC serial not supported"
148150
#endif

cores/arduino/UNO_compat.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#pragma once
1717
#include "Arduino.h"
1818

19+
#warning "ATMEGA328 registers emulation is enabled. You may encounter some speed issue. Please consider to disable it in the Tools menu"
20+
1921
/*
2022
ARDUINO PIN ATMEGA 328 ATMEGA 4809
2123
0 PD0 PC5
@@ -60,11 +62,6 @@
6062
#define SET_OR_CLEAR_DIR_REGISTER(inPosition, port, position) if ((uint8_t)~(1 << inPosition) & (uint8_t)value) { port.DIRSET = (1 << position); } else {port.DIRCLR = (1 << position); }
6163

6264

63-
typedef struct pinPort {
64-
volatile PORT_t* port;
65-
uint8_t pin;
66-
};
67-
6865
/** DDR Classes**/
6966
class DDRBClass {
7067
public:

0 commit comments

Comments
 (0)