Accept CC1101 chip version 4 was well as 20. Fixes Yellow APs

built with modules with older CC1101 chips.  Version 4 and 20
should cover all chips made from 2007 to 2021.
This commit is contained in:
Skip Hansen
2024-07-16 13:44:42 -07:00
parent fddf6169f1
commit 5c421648d1
3 changed files with 12 additions and 4 deletions

View File

@@ -701,10 +701,18 @@ bool CC1101_Present()
uint8_t PartNum = CC1101_readReg(CC1101_PARTNUM, CC1101_STATUS_REGISTER);
uint8_t ChipVersion = CC1101_readReg(CC1101_VERSION, CC1101_STATUS_REGISTER);
if(PartNum == 0 && ChipVersion == 20) {
if(PartNum == 0 && (ChipVersion == 20 || ChipVersion == 4)) {
LOGA("CC1101 detected\n");
Ret = true;
}
else {
if(PartNum != 0) {
LOGA("Invalid PartNum 0x%x\n",PartNum);
}
else {
LOGA("Invalid or unsupported ChipVersion 0x%x\n",ChipVersion);
}
}
return Ret;
}

View File

@@ -42,7 +42,7 @@ const uint8_t channelList[6] = {11, 15, 20, 25, 26, 27};
struct pendingData pendingDataArr[MAX_PENDING_MACS];
// VERSION GOES HERE!
uint16_t version = 0x001C;
uint16_t version = 0x001d;
#define RAW_PKT_PADDING 2

View File

@@ -39,7 +39,7 @@ void esp_ieee802154_receive_done(uint8_t *frame, esp_ieee802154_frame_info_t *fr
memcpy(inner_rxPKT, &frame[0], frame[0] + 1);
xQueueSendFromISR(packet_buffer, (void *)&inner_rxPKT, &xHigherPriorityTaskWoken);
portYIELD_FROM_ISR_ARG(xHigherPriorityTaskWoken);
esp_ieee802154_receive_handle_done(frame);
esp_ieee802154_receive_sfd_done();
}
void esp_ieee802154_transmit_failed(const uint8_t *frame, esp_ieee802154_tx_error_t error) {
@@ -50,7 +50,7 @@ void esp_ieee802154_transmit_failed(const uint8_t *frame, esp_ieee802154_tx_erro
void esp_ieee802154_transmit_done(const uint8_t *frame, const uint8_t *ack, esp_ieee802154_frame_info_t *ack_frame_info) {
isInTransmit = 0;
ESP_EARLY_LOGI(TAG, "TX %d", frame[0]);
esp_ieee802154_receive_handle_done(frame);
esp_ieee802154_receive_sfd_done();
}
static bool zigbee_is_enabled = false;
void radio_init(uint8_t ch) {