From f51afc1fbcf3d7b91a6b3c29765a5ff591c49d59 Mon Sep 17 00:00:00 2001 From: Brendan Le Foll Date: Wed, 14 Jan 2015 11:43:40 +0000 Subject: [PATCH] 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 --- api/mraa/pwm.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/mraa/pwm.hpp b/api/mraa/pwm.hpp index a627e41..ed93cc1 100644 --- a/api/mraa/pwm.hpp +++ b/api/mraa/pwm.hpp @@ -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); }