read back current and pwm limit
This commit is contained in:
parent
5fa8d27b5c
commit
c0eef162bd
14
i2c-slave.c
14
i2c-slave.c
@ -160,7 +160,19 @@ ISR(TWI_vect)
|
||||
case 0xB8:
|
||||
switch (cmd) {
|
||||
case CMD_WAIT:
|
||||
data = 0x00; /* TODO: transmit Current and MaxPWM */
|
||||
switch (bcnt++) {
|
||||
case 0:
|
||||
data = blmc.current & 0xFF;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
data = 0xFF - blmc.pwm_limit;
|
||||
break;
|
||||
|
||||
default:
|
||||
data = 0xFF;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case CMD_READ_VERSION:
|
||||
|
Loading…
Reference in New Issue
Block a user