Moved 'rtx.h' out of 'interfaces' folder, since it now becomes a cross-platform component

replace/665f8fcc578ca57a89894e29c5e619c16c96dc2e
Silvano Seva 2021-01-29 20:35:48 +01:00
rodzic 2fee6d0d06
commit 1840c1aeb5
4 zmienionych plików z 20 dodań i 18 usunięć

Wyświetl plik

@ -23,8 +23,8 @@
#include <stdint.h>
#include <stdbool.h>
#include <interfaces/rtx.h>
#include <datatypes.h>
#include <rtx.h>
/**
* \enum admit_t Enumeration type defining the admission criteria to a the

Wyświetl plik

@ -49,7 +49,7 @@ typedef struct
rtxStatus_t;
/**
* \enum bandwidth Enumeration type defining the bandwidth of the channel.
* \enum bandwidth Enumeration type defining the current rtx bandwidth.
*/
enum bandwidth
{
@ -59,8 +59,7 @@ enum bandwidth
};
/**
* \enum opmode Enumeration type defining the operating mode associated to each
* channel.
* \enum opmode Enumeration type defining the current rtx operating mode.
*/
enum opmode
{
@ -68,6 +67,9 @@ enum opmode
DMR = 1 /**< DMR */
};
/**
* \enum opstatus Enumeration type defining the current rtx operating status.
*/
enum opstatus
{
OFF = 0, /**< OFF */

Wyświetl plik

@ -28,7 +28,7 @@
#include <interfaces/platform.h>
#include <hwconfig.h>
#include <event.h>
#include <interfaces/rtx.h>
#include <rtx.h>
/* Mutex for concurrent access to state variable */
static OS_MUTEX state_mutex;
@ -100,7 +100,7 @@ static void ui_task(void *arg)
event_t event = ((event_t) msg);
// Lock mutex, read and write state
OSMutexPend(&state_mutex, 0u, OS_OPT_PEND_BLOCKING, 0u, &os_err);
OSMutexPend(&state_mutex, 0u, OS_OPT_PEND_BLOCKING, 0u, &os_err);
// React to keypresses and update FSM inside state
ui_updateFSM(event, &sync_rtx);
// Update state local copy
@ -221,12 +221,12 @@ static void kbd_task(void *arg)
event.type = EVENT_KBD;
event.payload = msg.value;
// Send keyboard status in queue
OSQPost(&ui_queue, (void *)event.value, sizeof(event_t),
OSQPost(&ui_queue, (void *)event.value, sizeof(event_t),
OS_OPT_POST_FIFO + OS_OPT_POST_NO_SCHED, &os_err);
}
// Save current keyboard state as previous
prev_keys = keys;
// Read keyboard state at 20Hz
OSTimeDlyHMSM(0u, 0u, 0u, 50u, OS_OPT_TIME_HMSM_STRICT, &os_err);
}
@ -246,7 +246,7 @@ static void dev_task(void *arg)
OSMutexPend(&state_mutex, 0u, OS_OPT_PEND_BLOCKING, 0u, &os_err);
#ifdef HAS_RTC
state.time = rtc_getTime();
state.time = rtc_getTime();
#endif
state.v_bat = platform_getVbat();
state.charge = battery_getCharge(state.v_bat);
@ -258,9 +258,9 @@ static void dev_task(void *arg)
event_t dev_msg;
dev_msg.type = EVENT_STATUS;
dev_msg.payload = 0;
OSQPost(&ui_queue, (void *)dev_msg.value, sizeof(event_t),
OSQPost(&ui_queue, (void *)dev_msg.value, sizeof(event_t),
OS_OPT_POST_FIFO + OS_OPT_POST_NO_SCHED, &os_err);
// Execute state update thread every 1s
OSTimeDlyHMSM(0u, 0u, 1u, 0u, OS_OPT_TIME_HMSM_STRICT, &os_err);
}
@ -310,7 +310,7 @@ void create_threads()
OSMutexCreate((OS_MUTEX *) &display_mutex,
(CPU_CHAR *) "Display Mutex",
(OS_ERR *) &os_err);
// State initialization, execute before starting all tasks
state_init();

Wyświetl plik

@ -64,7 +64,7 @@
#include <stdio.h>
#include <stdint.h>
#include <ui.h>
#include <interfaces/rtx.h>
#include <rtx.h>
#include <interfaces/platform.h>
#include <interfaces/nvmem.h>
#include <string.h>
@ -497,7 +497,7 @@ void _ui_fsm_confirmVFOInput(bool *sync_rtx) {
// Otherwise set both frequencies
else
{
if(_ui_freq_check_limits(ui_state.new_rx_frequency) &&
if(_ui_freq_check_limits(ui_state.new_rx_frequency) &&
_ui_freq_check_limits(ui_state.new_tx_frequency))
{
state.channel.rx_frequency = ui_state.new_rx_frequency;
@ -519,7 +519,7 @@ void _ui_fsm_insertVFONumber(kbd_msg_t msg, bool *sync_rtx) {
if(ui_state.input_position == 1)
ui_state.new_rx_frequency = 0;
// Calculate portion of the new RX frequency
ui_state.new_rx_frequency = _ui_freq_add_digit(ui_state.new_rx_frequency,
ui_state.new_rx_frequency = _ui_freq_add_digit(ui_state.new_rx_frequency,
ui_state.input_position, ui_state.input_number);
if(ui_state.input_position >= FREQ_DIGITS)
{
@ -536,12 +536,12 @@ void _ui_fsm_insertVFONumber(kbd_msg_t msg, bool *sync_rtx) {
if(ui_state.input_position == 1)
ui_state.new_tx_frequency = 0;
// Calculate portion of the new TX frequency
ui_state.new_tx_frequency = _ui_freq_add_digit(ui_state.new_tx_frequency,
ui_state.new_tx_frequency = _ui_freq_add_digit(ui_state.new_tx_frequency,
ui_state.input_position, ui_state.input_number);
if(ui_state.input_position >= FREQ_DIGITS)
{
// Save both inserted frequencies
if(_ui_freq_check_limits(ui_state.new_rx_frequency) &&
if(_ui_freq_check_limits(ui_state.new_rx_frequency) &&
_ui_freq_check_limits(ui_state.new_tx_frequency))
{
state.channel.rx_frequency = ui_state.new_rx_frequency;
@ -728,7 +728,7 @@ void ui_updateFSM(event_t event, bool *sync_rtx)
// Save pressed number to calculare frequency and show in GUI
ui_state.input_number = input_getPressedNumber(msg);
// Calculate portion of the new frequency
ui_state.new_rx_frequency = _ui_freq_add_digit(ui_state.new_rx_frequency,
ui_state.new_rx_frequency = _ui_freq_add_digit(ui_state.new_rx_frequency,
ui_state.input_position, ui_state.input_number);
}
break;