Merge branch 'DiSlord_test_branch'

pull/4/head
erikkaashoek 6 years ago
commit 3a307ad78e

@ -2208,13 +2208,13 @@ VNA_SHELL_FUNCTION(cmd_color)
#if CH_CFG_USE_REGISTRY == FALSE #if CH_CFG_USE_REGISTRY == FALSE
#error "Threads Requite enabled CH_CFG_USE_REGISTRY in chconf.h" #error "Threads Requite enabled CH_CFG_USE_REGISTRY in chconf.h"
#endif #endif
static const char *states[] = {CH_STATE_NAMES};
VNA_SHELL_FUNCTION(cmd_threads) VNA_SHELL_FUNCTION(cmd_threads)
{ {
static const char *states[] = {CH_STATE_NAMES};
thread_t *tp; thread_t *tp;
(void)argc; (void)argc;
(void)argv; (void)argv;
shell_printf("stklimit| |stk free| addr|refs|prio| state| name"VNA_SHELL_NEWLINE_STR); shell_printf("stklimit| |stk free| addr|refs|prio| state| name"VNA_SHELL_NEWLINE_STR);
tp = chRegFirstThread(); tp = chRegFirstThread();
do { do {
uint32_t max_stack_use = 0U; uint32_t max_stack_use = 0U;
@ -2783,8 +2783,8 @@ void hard_fault_handler_c(uint32_t *sp)
uint32_t pc = sp[6]; uint32_t pc = sp[6];
uint32_t psr = sp[7]; uint32_t psr = sp[7];
int y = 0; int y = 0;
int x = 20; int x = OFFSETX + 1;
static char buf[16]; static char buf[96];
ili9341_set_background(0x0000); ili9341_set_background(0x0000);
ili9341_set_foreground(0xFFFF); ili9341_set_foreground(0xFFFF);
@ -2805,7 +2805,27 @@ void hard_fault_handler_c(uint32_t *sp)
plot_printf(buf, sizeof(buf), "LR 0x%08x", lr);ili9341_drawstring(buf, x, y+=FONT_STR_HEIGHT); plot_printf(buf, sizeof(buf), "LR 0x%08x", lr);ili9341_drawstring(buf, x, y+=FONT_STR_HEIGHT);
plot_printf(buf, sizeof(buf), "PC 0x%08x", pc);ili9341_drawstring(buf, x, y+=FONT_STR_HEIGHT); plot_printf(buf, sizeof(buf), "PC 0x%08x", pc);ili9341_drawstring(buf, x, y+=FONT_STR_HEIGHT);
plot_printf(buf, sizeof(buf), "PSR 0x%08x", psr);ili9341_drawstring(buf, x, y+=FONT_STR_HEIGHT); plot_printf(buf, sizeof(buf), "PSR 0x%08x", psr);ili9341_drawstring(buf, x, y+=FONT_STR_HEIGHT);
#ifdef ENABLE_THREADS_COMMAND
thread_t *tp;
tp = chRegFirstThread();
do {
uint32_t max_stack_use = 0U;
#if (CH_DBG_ENABLE_STACK_CHECK == TRUE) || (CH_CFG_USE_DYNAMIC == TRUE)
uint32_t stklimit = (uint32_t)tp->wabase;
#if CH_DBG_FILL_THREADS == TRUE
uint8_t *p = (uint8_t *)tp->wabase; while(p[max_stack_use]==CH_DBG_STACK_FILL_VALUE) max_stack_use++;
#endif
#else
uint32_t stklimit = 0U;
#endif
plot_printf(buf, sizeof(buf), "%08x|%08x|%08x|%08x|%4u|%4u|%9s|%12s",
stklimit, (uint32_t)tp->ctx.sp, max_stack_use, (uint32_t)tp,
(uint32_t)tp->refs - 1, (uint32_t)tp->prio, states[tp->state],
tp->name == NULL ? "" : tp->name);
ili9341_drawstring(buf, x, y+=FONT_STR_HEIGHT);
tp = chRegNextThread(tp);
} while (tp != NULL);
#endif
shell_printf("===================================\r\n"); shell_printf("===================================\r\n");
#else #else
(void)sp; (void)sp;

@ -1322,40 +1322,22 @@ float perform(bool break_on_operation, int i, uint32_t f, int tracking) // M
// ----------------------------------------------------- modulation for output modes --------------------------------------- // ----------------------------------------------------- modulation for output modes ---------------------------------------
if (MODE_OUTPUT(setting.mode)){ if (MODE_OUTPUT(setting.mode)){
if (setting.modulation == MO_AM_1kHz || setting.modulation == MO_AM_10Hz) { // AM modulation if (setting.modulation == MO_AM_1kHz || setting.modulation == MO_AM_10Hz) { // AM modulation
int p = setting.attenuate * 2 + am_modulation[modulation_counter]; int p = setting.attenuate * 2 + am_modulation[modulation_counter++];
if (p>63) if (p>63) p = 63;
p = 63; else if (p< 0) p = 0;
if (p<0)
p = 0;
PE4302_Write_Byte(p); PE4302_Write_Byte(p);
if (modulation_counter == 4) { // 3dB modulation depth if (modulation_counter == 5) // 3dB modulation depth
modulation_counter = 0; modulation_counter = 0;
} else { my_microsecond_delay(setting.modulation == MO_AM_10Hz ? 20000 : 180);
modulation_counter++;
}
if (setting.modulation == MO_AM_10Hz)
my_microsecond_delay(20000);
else
my_microsecond_delay(180);
// chThdSleepMicroseconds(200);
} }
else if (setting.modulation == MO_NFM || setting.modulation == MO_WFM ) { //FM modulation else if (setting.modulation == MO_NFM || setting.modulation == MO_WFM ) { //FM modulation
SI4432_Sel = 1; SI4432_Sel = 1;
int offset; int offset = setting.modulation == MO_NFM ? nfm_modulation[modulation_counter] : wfm_modulation[modulation_counter] ;
if (setting.modulation == MO_NFM ) { SI4432_Write_Byte(SI4432_FREQ_OFFSET1, (offset & 0xff )); // Use frequency hopping channel for FM modulation
offset = nfm_modulation[modulation_counter] ; SI4432_Write_Byte(SI4432_FREQ_OFFSET2, ((offset >> 8) & 0x03 )); // Use frequency hopping channel for FM modulation
SI4432_Write_Byte(SI4432_FREQ_OFFSET1, (offset & 0xff )); // Use frequency hopping channel for FM modulation modulation_counter++;
SI4432_Write_Byte(SI4432_FREQ_OFFSET2, ((offset >> 8) & 0x03 )); // Use frequency hopping channel for FM modulation if (modulation_counter == 5) // 3dB modulation depth
}
else {
offset = wfm_modulation[modulation_counter] ;
SI4432_Write_Byte(SI4432_FREQ_OFFSET1, (offset & 0xff )); // Use frequency hopping channel for FM modulation
SI4432_Write_Byte(SI4432_FREQ_OFFSET2, ((offset >> 8) & 0x03 )); // Use frequency hopping channel for FM modulation
}
if (modulation_counter == 4)
modulation_counter = 0; modulation_counter = 0;
else
modulation_counter++;
my_microsecond_delay(200); my_microsecond_delay(200);
// chThdSleepMicroseconds(200); // chThdSleepMicroseconds(200);
} }

23
ui.c

@ -1907,29 +1907,22 @@ ui_mode_normal(void)
static void static void
lever_move_marker(int status) lever_move_marker(int status)
{ {
int step = 1; uint16_t step = 1<<2;
int count = 0;
do { do {
if (active_marker >= 0 && markers[active_marker].enabled) { if (active_marker >= 0 && markers[active_marker].enabled) {
if ((status & EVT_DOWN) && markers[active_marker].index > 0) { if (status & EVT_DOWN) {
markers[active_marker].index -= step; markers[active_marker].index -= step>>2;
if (markers[active_marker].index < 0) if (markers[active_marker].index < 0)
markers[active_marker].index = 0 ; markers[active_marker].index = 0 ;
markers[active_marker].frequency = frequencies[markers[active_marker].index];
redraw_marker(active_marker);
} }
if ((status & EVT_UP) && markers[active_marker].index < sweep_points-1) { if (status & EVT_UP) {
markers[active_marker].index += step; markers[active_marker].index += step>>2;
if (markers[active_marker].index > sweep_points-1) if (markers[active_marker].index > sweep_points-1)
markers[active_marker].index = sweep_points-1 ; markers[active_marker].index = sweep_points-1 ;
markers[active_marker].frequency = frequencies[markers[active_marker].index];
redraw_marker(active_marker);
}
count++;
if (count > 10) {
step *= 2;
count = 0;
} }
markers[active_marker].frequency = frequencies[markers[active_marker].index];
redraw_marker(active_marker);
step++;
} }
status = btn_wait_release(); status = btn_wait_release();
} while (status != 0); } while (status != 0);

@ -1679,11 +1679,6 @@ static void menu_item_modify_attribute(
if (item == 5 && get_waterfall()){ if (item == 5 && get_waterfall()){
mark = true; mark = true;
} }
#ifdef __SPUR__
if (item == 5 && setting.spur) {
mark = true;
}
#endif
} else if (menu == menu_settings) { } else if (menu == menu_settings) {
if (item ==0 && setting.tracking_output){ if (item ==0 && setting.tracking_output){
mark = true; mark = true;

Loading…
Cancel
Save

Powered by TurnKey Linux.