From aa7b28233feca05328aa7fa1158bf78d7c82c658 Mon Sep 17 00:00:00 2001 From: Tim Huyeng Date: Tue, 15 Nov 2022 11:58:33 +0100 Subject: [PATCH] add timer fix see: https://github.com/cyberman54/ESP32-Paxcounter/discussions/896 --- lib/libpax/libpax_api.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/libpax/libpax_api.cpp b/lib/libpax/libpax_api.cpp index 9d7cf9e..614175d 100644 --- a/lib/libpax/libpax_api.cpp +++ b/lib/libpax/libpax_api.cpp @@ -198,11 +198,14 @@ int libpax_counter_start() { int libpax_counter_stop() { wifi_sniffer_stop(); stop_BLE_scan(); - xTimerStop(PaxReportTimer, 0); - PaxReportTimer = NULL; + if (PaxReportTimer != NULL) { + xTimerStop(PaxReportTimer, 0); + PaxReportTimer = NULL; + } return 0; } + int libpax_counter_count(struct count_payload_t* count) { fill_counter(count); return 0;