mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-14 10:20:01 +00:00
uint16_t always >= 0
This commit is contained in:
1 parent
1494f5e831
commit
c6ee909aa4
1 file changed
+2
-2
@@ -7,7 +7,7 @@ static bool s_pins[MAX_PIN_NO];
|
||||
|
||||
bool gpio_write(uint16_t pin, bool status) {
|
||||
bool ok = false;
|
||||
if (pin >= 0 && pin < MAX_PIN_NO) {
|
||||
if (pin < MAX_PIN_NO) {
|
||||
s_pins[pin] = status;
|
||||
ok = true;
|
||||
}
|
||||
@@ -15,5 +15,5 @@ bool gpio_write(uint16_t pin, bool status) {
|
||||
}
|
||||
|
||||
bool gpio_read(uint16_t pin) {
|
||||
return (pin >= 0 && pin < MAX_PIN_NO) ? s_pins[pin] : false;
|
||||
return (pin < MAX_PIN_NO) ? s_pins[pin] : false;
|
||||
}
|
||||
Reference in new issue
Block a user