Skip to content

Quick Fix of overflow for larger toggle_count values #565

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cores/arduino/Tone.cpp
Original file line number Diff line number Diff line change
@@ -349,7 +349,7 @@ void tone(uint8_t _pin, unsigned int frequency, unsigned long duration)
// Calculate the toggle count
if (duration > 0)
{
toggle_count = 2 * frequency * duration / 1000;
toggle_count = 2 * (unsigned long)frequency * duration / 1000;
}
else
{

Unchanged files with check annotations Beta

/*++

Check warning on line 1 in drivers/FTDI USB Drivers/ftd2xx.h

GitHub Actions / spellcheck

Cannot decode file using encoding "utf-8"
Copyright © 2001-2021 Future Technology Devices International Limited
; FTDIBUS.INF

Check warning on line 1 in drivers/FTDI USB Drivers/ftdibus.inf

GitHub Actions / spellcheck

Cannot decode file using encoding "utf-8"
;
; Copyright © 2000-2021 Future Technology Devices International Limited
;
; FTDIPORT.INF

Check warning on line 1 in drivers/FTDI USB Drivers/ftdiport.inf

GitHub Actions / spellcheck

Cannot decode file using encoding "utf-8"
;
; Copyright © 2000-2021 Future Technology Devices International Limited
;
# Hey Emacs, this is a -*- makefile -*-

Check warning on line 1 in firmwares/atmegaxxu2/arduino-usbserial/makefile

GitHub Actions / spellcheck

Cannot decode file using encoding "utf-8"
#----------------------------------------------------------------------------
# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
# >> Modified for use with the LUFA project. <<
# Hey Emacs, this is a -*- makefile -*-

Check warning on line 1 in firmwares/atmegaxxu2/arduino-usbdfu/makefile

GitHub Actions / spellcheck

Cannot decode file using encoding "utf-8"
#----------------------------------------------------------------------------
# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
# >> Modified for use with the LUFA project. <<