Merge I2C command handler into main #18
@ -163,6 +163,9 @@ uint8_t route_command(int pos) {
|
|||||||
case WRITE_CONFIG:
|
case WRITE_CONFIG:
|
||||||
return WRITE_CONFIG;
|
return WRITE_CONFIG;
|
||||||
case READ_CONFIG:
|
case READ_CONFIG:
|
||||||
|
{
|
||||||
|
switch (context.conf) {
|
||||||
|
case SAMPLE_TIME:
|
||||||
{
|
{
|
||||||
// Validate that pos is within the valid range
|
// Validate that pos is within the valid range
|
||||||
if (pos >= 2) { return 0x00; }
|
if (pos >= 2) { return 0x00; }
|
||||||
@ -175,10 +178,11 @@ uint8_t route_command(int pos) {
|
|||||||
} config_value;
|
} config_value;
|
||||||
config_value.value = config.ms_fanspeed_sample_rate;
|
config_value.value = config.ms_fanspeed_sample_rate;
|
||||||
|
|
||||||
uint8_t data = config_value.bytes[1-pos];
|
|
||||||
|
|
||||||
// Return the corresponding data byte
|
// Return the corresponding data byte
|
||||||
return data;
|
return config_value.bytes[1-pos];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user