Merge pull request #385 from henrygab/patch-3

Fix #382: [-Wsign-compare]
This commit is contained in:
hathach authored and GitHub committed 2019-11-08 22:28:42 +07:00
commit 3606bbf125
1 file changed
+5 -5
@@ -128,10 +128,10 @@ BLEUuid uuid = BLEUuid(CUSTOM_UUID);
/* This struct is used to track detected nodes */
typedef struct node_record_s
{
uint8_t addr[6]; // Six byte device address
int8_t rssi; // RSSI value
int32_t timestamp; // Timestamp for invalidation purposes
int8_t reserved; // Padding for word alignment
uint8_t addr[6]; // Six byte device address
int8_t rssi; // RSSI value
uint32_t timestamp; // Timestamp for invalidation purposes
int8_t reserved; // Padding for word alignment
} node_record_t;
node_record_t records[ARRAY_SIZE];
@@ -530,7 +530,7 @@ int invalidateRecords(void)
{
if (records[i].timestamp) // Ignore zero"ed records
{
if (records[i].timestamp <= millis() - TIMEOUT_MS)
if (millis() - records[i].timestamp >= TIMEOUT_MS)
{
/* Record has expired, zero it out */
memset(&records[i], 0, sizeof(node_record_t));