@@ -35,7 +35,7 @@ using __uint24 = uint32_t;
35
35
36
36
namespace pmsx {
37
37
38
- constexpr char pmsxApiVersion[] = " pms5003 2.00 RC " ;
38
+ constexpr char pmsxApiVersion[] = " pms5003 2.00" ;
39
39
40
40
typedef uint16_t pmsData_t;
41
41
@@ -45,7 +45,7 @@ namespace pmsx {
45
45
public:
46
46
explicit PmsStatus (pmsStatus_t value) : value(value) {}
47
47
48
- operator pmsStatus_t () {
48
+ operator pmsStatus_t () const {
49
49
return value;
50
50
}
51
51
@@ -301,7 +301,7 @@ namespace pmsx {
301
301
optionalPin_t pinSleepMode;
302
302
optionalPin_t pinReset;
303
303
304
- void setupHardwarePin (uint8_t value) {
304
+ static void setupHardwarePin (uint8_t value) {
305
305
digitalWrite (value, HIGH);
306
306
pinMode (value, OUTPUT);
307
307
digitalWrite (value, HIGH);
@@ -373,7 +373,7 @@ namespace pmsx {
373
373
}
374
374
}
375
375
376
- bool initialized () {
376
+ bool initialized () const {
377
377
return pmsSerial;
378
378
}
379
379
@@ -398,7 +398,7 @@ namespace pmsx {
398
398
399
399
// //////////////////////////////////////
400
400
401
- void sumBuffer (uint16_t * sum, const uint8_t * buffer, uint16_t cnt) {
401
+ static void sumBuffer (uint16_t * sum, const uint8_t * buffer, uint16_t cnt) {
402
402
for (; cnt > 0 ; --cnt, ++buffer) {
403
403
*sum += *buffer;
404
404
}
@@ -601,7 +601,7 @@ namespace pmsx {
601
601
if (pmsSerial->write (sig, sizeof (sig)) != sizeof (sig)) {
602
602
return false ;
603
603
}
604
- const size_t cmdSize = 3 ;
604
+ constexpr auto cmdSize = uint8_t { 3 } ;
605
605
if (pmsSerial->write ((uint8_t *)&cmd, cmdSize) != cmdSize) {
606
606
return false ;
607
607
}
0 commit comments