something

This commit is contained in:
2025-05-18 21:33:59 +02:00
parent ac6f851b68
commit 4e33b053f4

View File

@ -125,7 +125,6 @@ int main() {
}
while (1) {
int numDevices = sizeof(devices) / sizeof(struct device);
for (int i = 0; i < numDevices; i++) {
setI2CAddress(devices[i].address);
i2cResponse = i2c_smbus_read_byte_data(i2c, 0);
@ -139,10 +138,13 @@ int main() {
sendI2CInit(devices[i]);
} else if (i2cResponse == DATA_STOP_BYTE) {
// expect no forther data from device
usleep(50 * 1000);
continue;
} else {
// real data
_log("data: 0x%02x\n", i2cResponse);
/*
XXX: put data into cache and handle with another core / loop / fork / whatever
if (i2cResponse & TRIGGER_BIT_1) {
if (i2cResponse & HIGH_BIT_1) {
sendI2CData(devices[i], TRIGGER_BIT_1, "+1+", 3);
@ -158,9 +160,9 @@ int main() {
sendI2CData(devices[i], TRIGGER_BIT_2, "-2-", 3);
}
}
*/
}
}
usleep(10 * 1000);
}
close(i2c);