Merge pull request #669 from NeroBurner/fix_unsigned_comparison_warning_metronome

Fix unsigned/signed comparison warning in Metronome.cpp
This commit is contained in:
JF002 2021-09-18 20:33:45 +02:00 committed by GitHub
commit 52eb94cfc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,7 +78,7 @@ Metronome::~Metronome() {
void Metronome::Refresh() { void Metronome::Refresh() {
if (metronomeStarted) { if (metronomeStarted) {
if (xTaskGetTickCount() - startTime > 60 * configTICK_RATE_HZ / bpm) { if (xTaskGetTickCount() - startTime > 60u * configTICK_RATE_HZ / static_cast<uint16_t>(bpm)) {
startTime += 60 * configTICK_RATE_HZ / bpm; startTime += 60 * configTICK_RATE_HZ / bpm;
counter--; counter--;
if (counter == 0) { if (counter == 0) {