Skip to content

Commit 5898012

Browse files
authored
Merge pull request #22 from yashmulgaonkar/master
fixed typecasting error in time periods in calculateSlopeRegister and…
2 parents 3a67e69 + 84ccb4f commit 5898012

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Diff for: src/SparkFunSX1509.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ void SX1509::configClock(uint8_t oscSource /*= 2*/, uint8_t oscPinFunction /*= 0
676676
writeByte(REG_MISC, regMisc);
677677
}
678678

679-
uint8_t SX1509::calculateLEDTRegister(uint8_t ms)
679+
uint8_t SX1509::calculateLEDTRegister(unsigned long ms)
680680
{
681681
uint8_t regOn1, regOn2;
682682
float timeOn1, timeOn2;
@@ -698,7 +698,7 @@ uint8_t SX1509::calculateLEDTRegister(uint8_t ms)
698698
return regOn2;
699699
}
700700

701-
uint8_t SX1509::calculateSlopeRegister(uint8_t ms, uint8_t onIntensity, uint8_t offIntensity)
701+
uint8_t SX1509::calculateSlopeRegister(unsigned long ms, uint8_t onIntensity, uint8_t offIntensity)
702702
{
703703
uint16_t regSlope1, regSlope2;
704704
float regTime1, regTime2;

Diff for: src/SparkFunSX1509.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ class SX1509
7575
// Helper functions:
7676
// calculateLEDTRegister - Try to estimate an LED on/off duration register,
7777
// given the number of milliseconds and LED clock frequency.
78-
uint8_t calculateLEDTRegister(uint8_t ms);
78+
uint8_t calculateLEDTRegister(unsigned long ms);
7979
// calculateSlopeRegister - Try to estimate an LED rise/fall duration
8080
// register, given the number of milliseconds and LED clock frequency.
81-
uint8_t calculateSlopeRegister(uint8_t ms, uint8_t onIntensity, uint8_t offIntensity);
81+
uint8_t calculateSlopeRegister(unsigned long ms, uint8_t onIntensity, uint8_t offIntensity);
8282

8383
public:
8484
// -----------------------------------------------------------------------------

0 commit comments

Comments
 (0)