Merge pull request #95 from derrohrbach/issue/missing-counter

Fix: Counter was missing
This commit is contained in:
rbaron 2023-01-14 11:31:59 +01:00 committed by GitHub
commit 119055b97a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,7 +24,10 @@ int prst_ble_encode_service_data(const prst_sensors_t* sensors,
#endif
// 4 bits for a small wrap-around counter for deduplicating messages on the
// receiver.
// out[3] = sensors->run_counter & 0x0f;
static uint8_t run_counter;
out[3] = run_counter++ & 0x0f;
out[4] = sensors->batt.adc_read.millivolts >> 8;
out[5] = sensors->batt.adc_read.millivolts & 0xff;
int16_t temp_centicelsius = 100 * sensors->shtc3.temp_c;