mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
* new ESPNOWRadio driver
* refactored the examples/*/main.cpp modules, moving radio specifics to variants/*/target modules * new Generic_ESPNOW_* target envs
This commit is contained in:
parent
9c165add61
commit
2224bddcb5
39 changed files with 568 additions and 249 deletions
|
|
@ -34,7 +34,9 @@ public:
|
|||
#endif
|
||||
|
||||
#if defined(PIN_BOARD_SDA) && defined(PIN_BOARD_SCL)
|
||||
#if PIN_BOARD_SDA >= 0 && PIN_BOARD_SCL >= 0
|
||||
Wire.begin(PIN_BOARD_SDA, PIN_BOARD_SCL);
|
||||
#endif
|
||||
#else
|
||||
Wire.begin();
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -50,6 +50,10 @@ void ESPNOWRadio::begin() {
|
|||
}
|
||||
}
|
||||
|
||||
void ESPNOWRadio::setTxPower(uint8_t dbm) {
|
||||
esp_wifi_set_max_tx_power(dbm * 4);
|
||||
}
|
||||
|
||||
uint32_t ESPNOWRadio::intID() {
|
||||
uint8_t mac[8];
|
||||
memset(mac, 0, sizeof(mac));
|
||||
|
|
@ -58,7 +62,7 @@ uint32_t ESPNOWRadio::intID() {
|
|||
memcpy(&n, &mac[0], 4);
|
||||
memcpy(&m, &mac[4], 4);
|
||||
|
||||
return n * m;
|
||||
return n + m;
|
||||
}
|
||||
|
||||
void ESPNOWRadio::startSendRaw(const uint8_t* bytes, int len) {
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ public:
|
|||
|
||||
float packetScore(float snr, int packet_len) override { return 0; }
|
||||
uint32_t intID();
|
||||
void setTxPower(uint8_t dbm);
|
||||
};
|
||||
|
||||
#if ESPNOW_DEBUG_LOGGING && ARDUINO
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue