diff --git a/ESP-IDF_Robot_RC/main/espnow_example_main.c b/ESP-IDF_Robot_RC/main/espnow_example_main.c index b4ef9397c..805bf77d0 100755 --- a/ESP-IDF_Robot_RC/main/espnow_example_main.c +++ b/ESP-IDF_Robot_RC/main/espnow_example_main.c @@ -462,6 +462,7 @@ void sensors_data_prepare(espnow_data_packet_t *send_packet) void sendData (void) { // Send data, specify receiver MAC address, pointer to the data being sent, and length of data being sent. sensors_data_t *buffer; + buffer = malloc(sizeof(sensors_data_t)); buffer->type = 1; buffer->crc = 0; buffer->x_axis = 0;