Private
Public Access
2
0

pwm.hpp: Pwm constructor optional arg order change

This means that you can initialise a non raw Pwm pin without having to redefine
chipid as -1 (anything but -1 enables raw mode for Pwm)

Fixes #93.

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2015-01-14 11:43:40 +00:00
parent b7a0856f51
commit f51afc1fbc

View File

@@ -42,12 +42,12 @@ class Pwm {
* instanciates a PWM object on a pin
*
* @param pin the pin number used on your board
* @param chipid the pwmchip to use, use only in raw mode
* @param owner if you are the owner of the pin the destructor will
* @param chipid the pwmchip to use, use only in raw mode
* unexport the pin from sysfs, default behaviour is you are the owner
* if the pinmapper exported it
*/
Pwm(int pin, int chipid=-1, bool owner = true) {
Pwm(int pin, bool owner=true, int chipid=-1) {
if (chipid == -1) {
m_pwm = mraa_pwm_init(pin);
}