diff --git a/nanovna.h b/nanovna.h index ef31829..c73f06f 100644 --- a/nanovna.h +++ b/nanovna.h @@ -27,6 +27,7 @@ #define __SA__ //#define __SI4432__ //#define __PE4302__ +#define __SI4463__ //#define __SIMULATION__ //#define __PIPELINE__ #define __SCROLL__ diff --git a/sa_core.c b/sa_core.c index 932e3e5..7703f6e 100644 --- a/sa_core.c +++ b/sa_core.c @@ -1737,6 +1737,9 @@ pureRSSI_t perform(bool break_on_operation, int i, uint32_t f, int tracking) do{ // wait for trigger to happen #ifdef __SI4432__ pureRSSI = DEVICE_TO_PURE_RSSI((deviceRSSI_t)SI4432_Read_Byte(SI4432_REG_RSSI)); +#endif +#ifdef __SI4463__ + pureRSSI = DEVICE_TO_PURE_RSSI((deviceRSSI_t)Si446x_RSSI()); #endif if (break_on_operation && operation_requested) // allow aborting a wait for trigger return 0; // abort @@ -1764,6 +1767,9 @@ pureRSSI_t perform(bool break_on_operation, int i, uint32_t f, int tracking) else { #ifdef __SI4432__ pureRSSI = SI4432_RSSI(lf, MODE_SELECT(setting.mode)); // Get RSSI, either from pre-filled buffer +#endif +#ifdef __SI4463__ + pureRSSI = Si446x_RSSI(); #endif } #ifdef __SPUR__ diff --git a/si4432.c b/si4432.c index 362d577..053fecc 100644 --- a/si4432.c +++ b/si4432.c @@ -1490,8 +1490,8 @@ int16_t Si446x_RSSI(void) // volatile si446x_state_t s = getState(); SI4463_do_api(data, 2, data, 3); - int16_t rssi = 16 * data[2]; - return rssi; + int16_t rssi = data[2] - 120 * 2; + return DEVICE_TO_PURE_RSSI(rssi); }