Skip to content
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

Fix/getMaxDuty #2902

Closed
wants to merge 7 commits into from
Closed
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
5 changes: 5 additions & 0 deletions Sming/Arch/Esp32/Core/HardwarePWM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,11 @@ uint32_t HardwarePWM::getDutyChan(uint8_t chan)
return (chan == PWM_BAD_CHANNEL) ? 0 : ledc_get_duty(pinToGroup(chan), pinToChannel(chan));
}

uint32_t HardwarePWM::getMaxDuty()
{
return maxduty;
}

bool HardwarePWM::setDutyChan(uint8_t chan, uint32_t duty, bool update)
{
if(chan == PWM_BAD_CHANNEL) {
Expand Down
5 changes: 5 additions & 0 deletions Sming/Arch/Esp8266/Core/HardwarePWM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ uint32_t HardwarePWM::getPeriod()
return pwm_get_period();
}

uint32_t getMaxDuty()
{
return maxduty;
}

void HardwarePWM::setPeriod(uint32_t period)
{
maxduty = PERIOD_TO_MAX_DUTY(period);
Expand Down
5 changes: 5 additions & 0 deletions Sming/Arch/Host/Core/HardwarePWM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ bool HardwarePWM::setDutyChan(uint8_t chan, uint32_t duty, bool update)
return false;
}

uint32_t HardwarePWM::getMaxDuty()
{
return 0;
}

uint32_t HardwarePWM::getPeriod()
{
return 0;
Expand Down
5 changes: 5 additions & 0 deletions Sming/Arch/Rp2040/Core/HardwarePWM.cpp.todo
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ uint32 HardwarePWM::getPeriod()
return pwm_get_period();
}

uint32_t HardwarePWM::getMaxDuty()
{
return maxduty;
}

/* Function Name: setPeriod
* Description: This function is used to set Period of PWM.
* Period / frequency will remain same for all pins.
Expand Down
1 change: 0 additions & 1 deletion Sming/Components/Network/src/Network/Mqtt/MqttClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ bool MqttClient::connect(const Url& url, const String& clientName)
debug_e("clientName cannot be empty");
return false;
}

if(getConnectionState() != eTCS_Ready) {
close();
debug_d("MQTT closed previous connection");
Expand Down
5 changes: 1 addition & 4 deletions Sming/Core/HardwarePWM.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,7 @@ class HardwarePWM
* @retval uint32_t Maximum permissible duty cycle
* @note Attempt to set duty of a pin above this value will fail
*/
uint32_t getMaxDuty()
{
return maxduty;
}
uint32_t getMaxDuty();

/** @brief This function is used to actually update the PWM.
*/
Expand Down
Loading