arduino / ArduinoCore-avr

The Official Arduino AVR core
https://www.arduino.cc
1.22k stars 1.04k forks source link

eu_dst.h wrong calculation od Daylight Saving Time #277

Open vprheli opened 5 years ago

vprheli commented 5 years ago

Calculation use wrong conditions. Please correct if (month == MARCH) { if (mday < d) return 0; if (mday > d) return ONE_HOUR; if (hour < 2) return 0; return ONE_HOUR; } if (mday < d) return ONE_HOUR; if (mday > d) return 0; if (hour < 2) return ONE_HOUR; return 0;

And check also usa_dst.h if there isn't similar error Vladimir

facchinm commented 5 years ago

Hi @vprheli , which file/toolchain are you referring to?

Robotto commented 5 years ago

It's the from the AVR libc toolchain. more info here: http://avr.2057.n7.nabble.com/bug-44327-eu-dst-is-broken-td21561.html

I'd vote against implementing the proposed fix from the above link, since it's ungraspable to ever fix again. But the link serves the purpose of confirming the bug.

Robotto commented 5 years ago

It seems i've fixed it, using most of the original code... but.. I'm not sure if eu_dst.h is included in any of the arduino git repos, so i'm not sure what to do now... If @someone could point me in the direction of the file, id be happy to do a pull request mentioning this issue...

facchinm commented 5 years ago

@Robotto the only way is fixing it upstream in avr-libc (if it still applies). Could anyone provide a minimal and reproducible test to check if toolchain 7.3.0 is still affected?

Robotto commented 5 years ago

Where is avr-libc being maintained? I'm seeing it hosted in several places...

On Tue, 17 Sep 2019, 09.33 Martino Facchin, notifications@github.com wrote:

@Robotto https://github.com/Robotto the only way is fixing it upstream in avr-libc (if it still applies). Could anyone provide a minimal and reproducible test to check if toolchain 7.3.0 is still affected?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/arduino/ArduinoCore-avr/issues/277?email_source=notifications&email_token=AAERV6DMRNMNB7AK63XIYS3QKCB27A5CNFSM4IXHIFO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD63TB2A#issuecomment-532099304, or mute the thread https://github.com/notifications/unsubscribe-auth/AAERV6EF6JAG5ETCQQHPDS3QKCB27ANCNFSM4IXHIFOQ .

facchinm commented 5 years ago

https://www.nongnu.org/avr-libc/ should be the project's home

Robotto commented 4 years ago

It is a known bug, which i've added my input to here: https://savannah.nongnu.org/bugs/?44327

There doesn't seem to be any way to do a pull request on the somewhat archaic looking nongnu bugtracking system... :/ ~Mark

On Fri, 20 Sep 2019 at 12:20, Martino Facchin notifications@github.com wrote:

https://www.nongnu.org/avr-libc/ should be the project's home

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/arduino/ArduinoCore-avr/issues/277?email_source=notifications&email_token=AAERV6CAMEID6TDBSIWMFY3QKSPXVA5CNFSM4IXHIFO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7GIOPI#issuecomment-533497661, or mute the thread https://github.com/notifications/unsubscribe-auth/AAERV6EBLJRH4YCEOOU2HIDQKSPXVANCNFSM4IXHIFOQ .

Robotto commented 2 years ago

This became relevant again at around 2 in the morning today ;)