[avr] cmd parameter checking for enable/disable
This commit is contained in:
parent
3cff549f8c
commit
035bc2d4fe
|
@ -289,8 +289,11 @@ void ctrlCmdGet(uint8_t cmd)
|
||||||
|
|
||||||
case 'e': /* port enabled | disabled */
|
case 'e': /* port enabled | disabled */
|
||||||
ctrlReadCharFromRxBuffer(&i);
|
ctrlReadCharFromRxBuffer(&i);
|
||||||
|
|
||||||
|
if (i < MAX_SENSORS) {
|
||||||
ctrlWriteCharToTxBuffer(i);
|
ctrlWriteCharToTxBuffer(i);
|
||||||
ctrlWriteCharToTxBuffer((enabled >> i) & 0x01);
|
ctrlWriteCharToTxBuffer((enabled >> i) & 0x01);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'p': /* phy-to-logical mapping */
|
case 'p': /* phy-to-logical mapping */
|
||||||
|
@ -374,6 +377,8 @@ void ctrlCmdSet(uint8_t cmd)
|
||||||
|
|
||||||
case 'e': /* port enabled | disabled */
|
case 'e': /* port enabled | disabled */
|
||||||
ctrlReadCharFromRxBuffer(&i);
|
ctrlReadCharFromRxBuffer(&i);
|
||||||
|
|
||||||
|
if (i < MAX_SENSORS) {
|
||||||
ctrlReadCharFromRxBuffer(&tmp8);
|
ctrlReadCharFromRxBuffer(&tmp8);
|
||||||
|
|
||||||
if (tmp8) {
|
if (tmp8) {
|
||||||
|
@ -385,6 +390,7 @@ void ctrlCmdSet(uint8_t cmd)
|
||||||
|
|
||||||
ctrlWriteCharToTxBuffer(i);
|
ctrlWriteCharToTxBuffer(i);
|
||||||
ctrlWriteCharToTxBuffer((enabled >> i) & 0x01);
|
ctrlWriteCharToTxBuffer((enabled >> i) & 0x01);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'p': /* phy-to-logical mapping */
|
case 'p': /* phy-to-logical mapping */
|
||||||
|
|
Loading…
Reference in New Issue