Skip to content

Commit

Permalink
(infinite loop) yield in main + Fq/Ch change + std=c++11
Browse files Browse the repository at this point in the history
  • Loading branch information
adaRT committed Apr 17, 2019
1 parent dcfef72 commit ee86c15
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ESPNOW_lib/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

CC = g++
CFLAGS = -g -Wall
CFLAGS = -g -Wall -std=c++11
INCLUDES = -I src/Includes/

default: all
Expand Down
10 changes: 7 additions & 3 deletions ESPNOW_lib/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ Etienne Arlaud
#include <unistd.h>
#include <sys/time.h>

#include <thread>

#include "ESPNOW_manager.h"
#include "ESPNOW_types.h"


using namespace std;

static uint8_t my_mac[6] = {0xF8, 0x1A, 0x67, 0xb7, 0xEB, 0x0B};
static uint8_t dest_mac[6] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
static uint8_t ESP_mac[6] = {0xB4,0xE6,0x2D,0xB5,0x9F,0x85};
Expand All @@ -32,7 +36,7 @@ int main(int argc, char **argv) {

nice(-20);

handler = new ESPNOW_manager(argv[1], DATARATE_12Mbps, CHANNEL_freq_10, my_mac, dest_mac, false);
handler = new ESPNOW_manager(argv[1], DATARATE_24Mbps, CHANNEL_freq_9, my_mac, dest_mac, false);

handler->set_filter(ESP_mac, dest_mac);

Expand All @@ -41,7 +45,7 @@ int main(int argc, char **argv) {
handler->start();

while(1) {
sleep(1);
std::this_thread::yield();
}

handler->end();
Expand Down

0 comments on commit ee86c15

Please sign in to comment.