Skip to content

Commit 3606bbf

Browse files
authored
Merge pull request #385 from henrygab/patch-3
Fix #382: [-Wsign-compare]
2 parents d6f41d4 + e77217c commit 3606bbf

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

libraries/Bluefruit52Lib/examples/Projects/rssi_proximity/rssi_proximity_central/rssi_proximity_central.ino

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ BLEUuid uuid = BLEUuid(CUSTOM_UUID);
128128
/* This struct is used to track detected nodes */
129129
typedef struct node_record_s
130130
{
131-
uint8_t addr[6]; // Six byte device address
132-
int8_t rssi; // RSSI value
133-
int32_t timestamp; // Timestamp for invalidation purposes
134-
int8_t reserved; // Padding for word alignment
131+
uint8_t addr[6]; // Six byte device address
132+
int8_t rssi; // RSSI value
133+
uint32_t timestamp; // Timestamp for invalidation purposes
134+
int8_t reserved; // Padding for word alignment
135135
} node_record_t;
136136

137137
node_record_t records[ARRAY_SIZE];
@@ -530,7 +530,7 @@ int invalidateRecords(void)
530530
{
531531
if (records[i].timestamp) // Ignore zero"ed records
532532
{
533-
if (records[i].timestamp <= millis() - TIMEOUT_MS)
533+
if (millis() - records[i].timestamp >= TIMEOUT_MS)
534534
{
535535
/* Record has expired, zero it out */
536536
memset(&records[i], 0, sizeof(node_record_t));

0 commit comments

Comments
 (0)