Skip to content

fixed typecasting error in time periods in calculateSlopeRegister and… #22

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

Merged
merged 1 commit into from
Jun 20, 2023
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/SparkFunSX1509.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ void SX1509::configClock(uint8_t oscSource /*= 2*/, uint8_t oscPinFunction /*= 0
writeByte(REG_MISC, regMisc);
}

uint8_t SX1509::calculateLEDTRegister(uint8_t ms)
uint8_t SX1509::calculateLEDTRegister(unsigned long ms)
{
uint8_t regOn1, regOn2;
float timeOn1, timeOn2;
Expand All @@ -698,7 +698,7 @@ uint8_t SX1509::calculateLEDTRegister(uint8_t ms)
return regOn2;
}

uint8_t SX1509::calculateSlopeRegister(uint8_t ms, uint8_t onIntensity, uint8_t offIntensity)
uint8_t SX1509::calculateSlopeRegister(unsigned long ms, uint8_t onIntensity, uint8_t offIntensity)
{
uint16_t regSlope1, regSlope2;
float regTime1, regTime2;
Expand Down
4 changes: 2 additions & 2 deletions src/SparkFunSX1509.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ class SX1509
// Helper functions:
// calculateLEDTRegister - Try to estimate an LED on/off duration register,
// given the number of milliseconds and LED clock frequency.
uint8_t calculateLEDTRegister(uint8_t ms);
uint8_t calculateLEDTRegister(unsigned long ms);
// calculateSlopeRegister - Try to estimate an LED rise/fall duration
// register, given the number of milliseconds and LED clock frequency.
uint8_t calculateSlopeRegister(uint8_t ms, uint8_t onIntensity, uint8_t offIntensity);
uint8_t calculateSlopeRegister(unsigned long ms, uint8_t onIntensity, uint8_t offIntensity);

public:
// -----------------------------------------------------------------------------
Expand Down