experimental bug fix memory threshold
This commit is contained in:
parent
06e68459c8
commit
14b00196de
@ -99,17 +99,16 @@ static void gap_callback_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_pa
|
|||||||
switch (event)
|
switch (event)
|
||||||
{
|
{
|
||||||
case ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT:
|
case ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT:
|
||||||
{ // restart scan
|
// restart scan
|
||||||
status = esp_ble_gap_start_scanning(cfg.blescantime);
|
status = esp_ble_gap_start_scanning(cfg.blescantime);
|
||||||
if (status != ESP_OK)
|
if (status != ESP_OK)
|
||||||
{
|
{
|
||||||
ESP_LOGE(TAG, "esp_ble_gap_start_scanning: rc=%d", status);
|
ESP_LOGE(TAG, "esp_ble_gap_start_scanning: rc=%d", status);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ESP_GAP_BLE_SCAN_RESULT_EVT:
|
case ESP_GAP_BLE_SCAN_RESULT_EVT:
|
||||||
{
|
// evaluate scan results
|
||||||
if ( p->scan_rst.search_evt == ESP_GAP_SEARCH_INQ_CMPL_EVT) // Inquiry complete, scan is done
|
if ( p->scan_rst.search_evt == ESP_GAP_SEARCH_INQ_CMPL_EVT) // Inquiry complete, scan is done
|
||||||
{ // restart scan
|
{ // restart scan
|
||||||
status = esp_ble_gap_start_scanning (cfg.blescantime);
|
status = esp_ble_gap_start_scanning (cfg.blescantime);
|
||||||
@ -177,8 +176,6 @@ static void gap_callback_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_pa
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -136,6 +136,7 @@ void do_send(osjob_t* j){
|
|||||||
if (cfg.countermode != 1) {
|
if (cfg.countermode != 1) {
|
||||||
reset_counters(); // clear macs container and reset all counters
|
reset_counters(); // clear macs container and reset all counters
|
||||||
reset_salt(); // get new salt for salting hashes
|
reset_salt(); // get new salt for salting hashes
|
||||||
|
ESP_LOGI(TAG, "Counter cleared (countermode = %d)", cfg.countermode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -627,7 +627,10 @@ void loop() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// check free memory
|
// check free memory
|
||||||
if (ESP.getFreeHeap() <= MEM_LOW) {
|
//if (ESP.getFreeHeap() <= MEM_LOW) {
|
||||||
|
if (esp_get_minimum_free_heap_size() <= MEM_LOW) {
|
||||||
|
// ESP_LOGI(TAG, "Counter cleared (memory low = %d Bytes)", ESP.getFreeHeap());
|
||||||
|
ESP_LOGI(TAG, "Counter cleared (memory low water mark = %d Bytes)", esp_get_minimum_free_heap_size());
|
||||||
do_send(&sendjob); // send count
|
do_send(&sendjob); // send count
|
||||||
reset_counters(); // clear macs container and reset all counters
|
reset_counters(); // clear macs container and reset all counters
|
||||||
reset_salt(); // get new salt for salting hashes
|
reset_salt(); // get new salt for salting hashes
|
||||||
|
Loading…
Reference in New Issue
Block a user