mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-14 02:17:39 +00:00
added radio saturation to performance counter (#1734)
This commit is contained in:
@@ -95,6 +95,20 @@ void BasebandThread::run() {
|
||||
buffer_c8_t buffer{
|
||||
buffer_tmp.p, buffer_tmp.count, sampling_rate_};
|
||||
|
||||
if (shared_memory.request_m4_performance_counter == 0x02) {
|
||||
uint8_t max = shared_memory.m4_performance_counter;
|
||||
for (size_t i = 0; i < buffer_tmp.count; i++) {
|
||||
int8_t a = buffer_tmp.p[i].real();
|
||||
if (a < 0)
|
||||
a = -a;
|
||||
|
||||
if (a > max)
|
||||
max = a;
|
||||
}
|
||||
|
||||
shared_memory.m4_performance_counter = max;
|
||||
}
|
||||
|
||||
if (baseband_processor_) {
|
||||
baseband_processor_->execute(buffer);
|
||||
}
|
||||
|
@@ -135,13 +135,17 @@ void update_performance_counters() {
|
||||
|
||||
last_paint_state = !last_paint_state;
|
||||
|
||||
auto utilisation = get_cpu_utilisation_in_percent();
|
||||
auto free_stack = (uint32_t)get_free_stack_space();
|
||||
auto free_heap = chCoreStatus();
|
||||
if (performance_counter_active == 0x01) {
|
||||
auto utilisation = get_cpu_utilisation_in_percent();
|
||||
auto free_stack = (uint32_t)get_free_stack_space();
|
||||
auto free_heap = chCoreStatus();
|
||||
|
||||
shared_memory.m4_cpu_usage = utilisation;
|
||||
shared_memory.m4_stack_usage = free_stack;
|
||||
shared_memory.m4_heap_usage = free_heap;
|
||||
shared_memory.m4_performance_counter = utilisation;
|
||||
shared_memory.m4_stack_usage = free_stack;
|
||||
shared_memory.m4_heap_usage = free_heap;
|
||||
} else if (performance_counter_active == 0x02) {
|
||||
shared_memory.m4_performance_counter = 0;
|
||||
}
|
||||
}
|
||||
|
||||
} /* extern "C" */
|
||||
|
Reference in New Issue
Block a user