Cleanup
This commit is contained in:
parent
b61bead60a
commit
5ad3c07f4b
|
@ -443,7 +443,9 @@ void update_airtime() {
|
|||
}
|
||||
longterm_channel_util = (float)longterm_channel_util_sum/(float)AIRTIME_BINS;
|
||||
|
||||
#if MCU_VARIANT == MCU_ESP32
|
||||
update_csma_p();
|
||||
#endif
|
||||
kiss_indicate_channel_stats();
|
||||
#endif
|
||||
}
|
||||
|
@ -1097,12 +1099,14 @@ void validate_status() {
|
|||
}
|
||||
}
|
||||
|
||||
#if MCU_VARIANT == MCU_ESP32
|
||||
#define _e 2.71828183
|
||||
#define _S 10.0
|
||||
float csma_slope(float u) { return (pow(_e,_S*u-_S/2.0))/(pow(_e,_S*u-_S/2.0)+1.0); }
|
||||
void update_csma_p() {
|
||||
csma_p = (uint8_t)((1.0-(csma_p_min+(csma_p_max-csma_p_min)*csma_slope(airtime)))*255.0);
|
||||
}
|
||||
#endif
|
||||
|
||||
void loop() {
|
||||
if (radio_online) {
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue