Skip to content

Commit 86a7cab

Browse files
committed
Move HIDPowerDevice_::begin impl. to constructor
Proposal to simplify the implementation by avoiding the need for manually calling begin() before using HIDPowerDevice_.
1 parent 5cc9595 commit 86a7cab

File tree

3 files changed

+0
-7
lines changed

3 files changed

+0
-7
lines changed

examples/UPS/UPS.ino

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ int iRes=0;
4747
void setup() {
4848

4949
Serial.begin(57600);
50-
51-
PowerDevice.begin();
5250

5351
// Serial No is set in a special way as it forms Arduino port name
5452
PowerDevice.setSerial(STRING_SERIAL);

src/HIDPowerDevice.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,15 +226,11 @@ HIDPowerDevice_::HIDPowerDevice_(void) {
226226
static HIDSubDescriptor node(_hidReportDescriptor, sizeof (_hidReportDescriptor));
227227

228228
HID().AppendDescriptor(&node);
229-
}
230229

231-
void HIDPowerDevice_::begin(void) {
232230
// set string ID here
233-
234231
HID().SetFeature(HID_PD_IPRODUCT, &bProduct, sizeof(bProduct));
235232
HID().SetFeature(HID_PD_SERIAL, &bSerial, sizeof(bSerial));
236233
HID().SetFeature(HID_PD_MANUFACTURER, &bManufacturer, sizeof(bManufacturer));
237-
238234
}
239235

240236
void HIDPowerDevice_::setOutput(Serial_& out) {

src/HIDPowerDevice.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ class HIDPowerDevice_ {
102102

103103
public:
104104
HIDPowerDevice_(void);
105-
void begin(void);
106105

107106
void setOutput(Serial_&);
108107

0 commit comments

Comments
 (0)