fixed instant power
who doesn't love bit flipping
This commit is contained in:
@@ -44,16 +44,17 @@ namespace Hardware
|
||||
|
||||
Console.WriteLine($"Accumulated power: {accumPower} watt (Rollover 65536)");
|
||||
|
||||
int instantPower = (bytes[5]) | (bytes[6]>>4)<<8;
|
||||
int instantPower = (bytes[5]) | (bytes[6] & 0b00001111)<<8;
|
||||
|
||||
|
||||
if (instantPower != 0xFFF)
|
||||
Console.WriteLine($"Instant power: {instantPower} watt (Range 0-4094)");
|
||||
|
||||
int trainerStatus = bytes[6] & 0b00001111; // bit 4-7
|
||||
int trainerStatus = bytes[6] & 0b11110000; // bit 4-7
|
||||
int flags = bytes[7] >> 4;
|
||||
int FEState = bytes[7] & 0b00001111;
|
||||
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user