MCUdude / MegaCore

Arduino hardware package for ATmega64, ATmega128, ATmega165, ATmega169, ATmega325, ATmega329, ATmega640, ATmega645, ATmega649, ATmega1280, ATmega1281, ATmega2560, ATmega2561, ATmega3250, ATmega3290, ATmega6450, ATmega6490, AT90CAN32, AT90CAN64 and AT90CAN128
Other
384 stars 118 forks source link

Problem using 1Wire-libs #146

Closed Greece2 closed 3 years ago

Greece2 commented 3 years ago

Hi, I'm not sure if it is the Board lib (MegaCore, MiniCore) or if the problem lies in the libraries to read 1Wire-Sensors. Using the ATmega128 or the ATmega328 from the MegaCore for example, I get the following error messages (only the first lines copied):

In file included from W:\libraries\DS18B20\src/DS18B20.h:4:0, from W:\libraries\DS18B20\src\DS18B20.cpp:1: W:\libraries\DS18B20\src\DS18B20.cpp: In member function 'void DS18B20::setResolution(uint8_t)': C:\Users\XYZ\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.0.8\cores\MCUdude_corefiles/Arduino.h:133:22: error: 'l' was not declared in this scope typeof (low) _l = (l); \ ^ W:\libraries\DS18B20\src\DS18B20.cpp:104:18: note: in expansion of macro 'constrain' resolution = constrain(resolution, 9, 12); ^~~~~

Using other Board libs, like the "Arduino Mega 2560" or the "ATmega328 on a breadboard" , everything compiles fine. So, could it be the MegaCore / MiniCore lib that's causing the problem ?

Thanks for your help !

MCUdude commented 3 years ago

A bug in the constrain() and round() macros was introduced in the latest release for all my cores. I hope I can have it fixed in all cores (MightyCore, MiniCore, MegaCore, MajorCore, and MicroCore) by tonight. Meanwhile, you can try the previous boards manager release.

Greece2 commented 3 years ago

Thanks for the superfast reply ! I'll roll back to the previous version for now.

MCUdude commented 3 years ago

MegaCore v2.0.6 is now available!