aikopras / AP_DCC_Decoder_Core

Core library for DCC accessory decoders that use the RS-Bus for feedback. PoM feedback messages use (instead of RailCom) the RS-Bus with address 128.
GNU General Public License v3.0
0 stars 0 forks source link

unable to compile with ATMEGA480X CPU ( but OK with every_nano) #1

Closed LaurentR59 closed 1 year ago

LaurentR59 commented 2 years ago

Hi

I can compile the provided code with ATMEGA328P ATMEGA2560 AVR_DA and AVR_DB without any problem! Great and many thanks for provided code.

I can succeed in such operation with NANO_EVERY board.

Anyway trying to compile with CPU like ATMEGA4808 or 4908 I got the following issue (under plateformIO but not in relationship here)) ... file included from .pio\libdeps\ATMEGA4809\AP_DCC_Library\src\sup_isr.cpp:44:0: .pio\libdeps\ATMEGA4809\AP_DCC_Library\src\sup_isr_MegaCoreX_DxCore.h: In member function 'void DccMessage::initEventSystem(uint8_t)': .pio\libdeps\ATMEGA4809\AP_DCC_Library\src\sup_isr_MegaCoreX_DxCore.h:182:27: error: 'assign_generator_pin' is not a member of 'Event' Event& myEvent = Event::assign_generator_pin(dccPin); ^~~~~~~~ *** [.pio\build\ATMEGA4809\lib0a0\AP_DCC_Library\sup_isr.cpp.o] Error 1

So any idea to fix it? ( maybe quite nothing to do!)

Rm to succeed in plateformio with NANO board users need to set build_unflag element to avoid issue on compile.

[env:nano_every] platform = https://github.com/platformio/platform-atmelmegaavr.git platform_packages = framework-arduino-megaavr-megacorex framework-arduino-megaavr-dxcore framework-arduino-megaavr framework-arduino-megaavr-megatinycore

toolchain-atmelavr

framework = arduino board = nano_every board_build.f_cpu = 16000000L board_hardware.oscillator = internal build_unflags = -D AVR_NANO_4809_328MODE lib_deps = aikopras/AP_DCC_Library@^1.2.1

Thanks in advance to help to fix this issue.

Regards Laurent

aikopras commented 1 year ago

Hi Laurent Sorry for reacting late, I had not seen this post. I hope you've been able to solve it yourself.

I'm not 100% sure I understand the issue, also since I'm not using Platform IO. Anyway, "assign_generator_pin" is something from the Event library, and that library went through some improvements. Can it be that your version of the Event Library is not the latest (V1.1.0)?

Before V1.1.0 the Event library did not support the use of Arduino pin numbers, and "assign_generator_pin" was not implemented. See also: https://github.com/MCUdude/MegaCoreX/issues/126