mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-08-12 07:47:17 +00:00
ESP32-C3 RC & Receiver
This commit is contained in:
@@ -9,6 +9,13 @@
|
|||||||
|
|
||||||
static const char *TAG = "RC";
|
static const char *TAG = "RC";
|
||||||
|
|
||||||
|
void deletePeer (void) {
|
||||||
|
uint8_t delStatus = esp_now_del_peer(receiver_mac);
|
||||||
|
if (delStatus != 0) {
|
||||||
|
ESP_LOGE("ESP-NOW", "Could not delete peer");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void onDataSent (uint8_t *mac_addr, esp_now_send_status_t status) {
|
void onDataSent (uint8_t *mac_addr, esp_now_send_status_t status) {
|
||||||
//status == ESP_NOW_SEND_SUCCESS ? "Delivery Success" : "Delivery Fail");
|
//status == ESP_NOW_SEND_SUCCESS ? "Delivery Success" : "Delivery Fail");
|
||||||
ESP_LOGW(TAG, "Packet send status: %i", status);
|
ESP_LOGW(TAG, "Packet send status: %i", status);
|
||||||
@@ -98,7 +105,7 @@ static void rc_send_data_task (void *arg) {
|
|||||||
ESP-NOW
|
ESP-NOW
|
||||||
*/
|
*/
|
||||||
/* Prepare ESPNOW data to be sent. */
|
/* Prepare ESPNOW data to be sent. */
|
||||||
void sensors_data_prepare(espnow_data_packet_t *send_packet)
|
/*void sensors_data_prepare(espnow_data_packet_t *send_packet)
|
||||||
{
|
{
|
||||||
//sensors_data_t *buffer;
|
//sensors_data_t *buffer;
|
||||||
//malloc(sizeof(sensors_data_t));
|
//malloc(sizeof(sensors_data_t));
|
||||||
@@ -118,10 +125,4 @@ void sensors_data_prepare(espnow_data_packet_t *send_packet)
|
|||||||
buffer->motor4_rpm_pcm = 0;
|
buffer->motor4_rpm_pcm = 0;
|
||||||
ESP_LOGW(TAG, "x-axis: %x", (uint8_t)buffer->x_axis);
|
ESP_LOGW(TAG, "x-axis: %x", (uint8_t)buffer->x_axis);
|
||||||
buffer->crc = esp_crc16_le(UINT16_MAX, (uint8_t const *)buffer, send_packet->len);
|
buffer->crc = esp_crc16_le(UINT16_MAX, (uint8_t const *)buffer, send_packet->len);
|
||||||
}
|
}*/
|
||||||
void deletePeer (void) {
|
|
||||||
uint8_t delStatus = esp_now_del_peer(receiver_mac);
|
|
||||||
if (delStatus != 0) {
|
|
||||||
ESP_LOGE("ESP-NOW", "Could not delete peer");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Reference in New Issue
Block a user