Is anyone working on this or has anyone tried doing it? It doesn't seem like a hard change to make, since the code just needs to be adjusted to take one of the channel values, scale it in the 0-1023 range (to keep it compatible with analog RSSI readings?), and save it to analog.rssi, correct?
thinking something like the following
config.h
Code: Select all
/********************************************************************/
/**** RSSI ****/
/********************************************************************/
#define RX_RSSI
//#define RX_RSSI_PIN A3
#define RX_RSSI_CHAN 8 //RSSI injection on selected channel (for PPM, SBUS, etc.)
multiwii.cpp
Code: Select all
#if defined(RX_RSSI)
case 2:
{
static uint8_t ind = 0;
static uint16_t rvec[RSSI_SMOOTH], rsum;
#ifdef(RX_RSSI_CHAN)
uint16_t r = (uint16_t) rcData[RX_RSSI_CHAN]; //range [1000:2000]
r=(r-1000)*1023/1000; //scale to 0-1023 range
#else
uint16_t r = analogRead(RX_RSSI_PIN);
#endif
#if RSSI_SMOOTH == 1
analog.rssi = r;
#else
rsum += r;
rsum -= rvec[ind];
rvec[ind++] = r;
ind %= RSSI_SMOOTH;
r = rsum / RSSI_SMOOTH;
analog.rssi = r;
#endif
break;
}
#endif
any thoughts?