Input sweep time setting added

tinySA-v0.2
erikkaashoek 6 years ago
parent 528895b6e8
commit eb706a2728

@ -65,7 +65,7 @@ endif
# Stack size to be allocated to the Cortex-M process stack. This stack is # Stack size to be allocated to the Cortex-M process stack. This stack is
# the stack used by the main() thread. # the stack used by the main() thread.
ifeq ($(USE_PROCESS_STACKSIZE),) ifeq ($(USE_PROCESS_STACKSIZE),)
USE_PROCESS_STACKSIZE = 0x200 USE_PROCESS_STACKSIZE = 0x240
endif endif
# Stack size to the allocated to the Cortex-M main/exceptions stack. This # Stack size to the allocated to the Cortex-M main/exceptions stack. This

@ -710,6 +710,7 @@ void ui_mode_menu(void);
#define OP_NONE 0x00 #define OP_NONE 0x00
#define OP_LEVER 0x01 #define OP_LEVER 0x01
#define OP_TOUCH 0x02 #define OP_TOUCH 0x02
#define OP_CONSOLE 0x04
//#define OP_FREQCHANGE 0x04 //#define OP_FREQCHANGE 0x04
extern volatile uint8_t operation_requested; extern volatile uint8_t operation_requested;

@ -52,7 +52,6 @@ void reset_settings(int m)
setting.level = -15.0; setting.level = -15.0;
setting.trigger_level = -150.0; setting.trigger_level = -150.0;
setting.linearity_step = 0; setting.linearity_step = 0;
setting.sweep_time = 100;
trace[TRACE_STORED].enabled = false; trace[TRACE_STORED].enabled = false;
trace[TRACE_TEMP].enabled = false; trace[TRACE_TEMP].enabled = false;
setting.refer = -1; setting.refer = -1;
@ -66,6 +65,7 @@ void reset_settings(int m)
set_sweep_frequency(ST_START, (uint32_t) 0); set_sweep_frequency(ST_START, (uint32_t) 0);
set_sweep_frequency(ST_STOP, (uint32_t) 350000000); set_sweep_frequency(ST_STOP, (uint32_t) 350000000);
setting.attenuate = 30; setting.attenuate = 30;
setting.sweep_time = 0;
break; break;
#ifdef __ULTRA__ #ifdef __ULTRA__
case M_ULTRA: case M_ULTRA:
@ -74,6 +74,7 @@ void reset_settings(int m)
set_sweep_frequency(ST_START, (uint32_t) minFreq); set_sweep_frequency(ST_START, (uint32_t) minFreq);
set_sweep_frequency(ST_STOP, (uint32_t) maxFreq); set_sweep_frequency(ST_STOP, (uint32_t) maxFreq);
setting.attenuate = 0; setting.attenuate = 0;
setting.sweep_time = 0;
break; break;
#endif #endif
case M_GENLOW: case M_GENLOW:
@ -82,6 +83,7 @@ void reset_settings(int m)
maxFreq = 520000000; maxFreq = 520000000;
set_sweep_frequency(ST_CENTER, (int32_t) 10000000); set_sweep_frequency(ST_CENTER, (int32_t) 10000000);
set_sweep_frequency(ST_SPAN, 0); set_sweep_frequency(ST_SPAN, 0);
setting.sweep_time = 100;
break; break;
case M_HIGH: case M_HIGH:
#ifdef __ULTRA_SA__ #ifdef __ULTRA_SA__
@ -93,6 +95,7 @@ void reset_settings(int m)
#endif #endif
set_sweep_frequency(ST_START, (int32_t) minFreq); set_sweep_frequency(ST_START, (int32_t) minFreq);
set_sweep_frequency(ST_STOP, (int32_t) maxFreq); set_sweep_frequency(ST_STOP, (int32_t) maxFreq);
setting.sweep_time = 0;
break; break;
case M_GENHIGH: case M_GENHIGH:
setting.drive=8; setting.drive=8;
@ -100,6 +103,7 @@ void reset_settings(int m)
maxFreq = 960000000; maxFreq = 960000000;
set_sweep_frequency(ST_CENTER, (int32_t) 300000000); set_sweep_frequency(ST_CENTER, (int32_t) 300000000);
set_sweep_frequency(ST_SPAN, 0); set_sweep_frequency(ST_SPAN, 0);
setting.sweep_time = 100;
break; break;
} }
for (int i = 0; i< MARKERS_MAX; i++) { for (int i = 0; i< MARKERS_MAX; i++) {
@ -744,7 +748,7 @@ case M_GENHIGH: // Direct output from 1
void update_rbw(void) void update_rbw(void)
{ {
if (setting.frequency_step > 0) { if (setting.frequency_step > 0 && MODE_INPUT(setting.mode)) {
setting.vbw = (setting.frequency_step)/1000.0; setting.vbw = (setting.frequency_step)/1000.0;
actual_rbw = setting.rbw; actual_rbw = setting.rbw;
// float old_rbw = actual_rbw; // float old_rbw = actual_rbw;
@ -1169,7 +1173,7 @@ again:
// shell_printf("%d %.3f %.3f %.1f\r\n", i, local_IF/1000000.0, lf/1000000.0, subRSSI); // shell_printf("%d %.3f %.3f %.1f\r\n", i, local_IF/1000000.0, lf/1000000.0, subRSSI);
if (wait_for_trigger) { // wait for trigger to happen if (wait_for_trigger) { // wait for trigger to happen
if (operation_requested && break_on_operation) if ((operation_requested || shell_function) && break_on_operation)
break; // abort break; // abort
if (subRSSI < setting.trigger_level) if (subRSSI < setting.trigger_level)
goto wait; goto wait;
@ -1192,7 +1196,7 @@ again:
if (RSSI < subRSSI) // Take max during subscanning if (RSSI < subRSSI) // Take max during subscanning
RSSI = subRSSI; RSSI = subRSSI;
t++; t++;
if (operation_requested && break_on_operation) // break subscanning if requested if ((operation_requested || shell_function ) && break_on_operation) // break subscanning if requested
break; // abort break; // abort
} while (t < vbwSteps); } while (t < vbwSteps);
return(RSSI); return(RSSI);
@ -1227,19 +1231,21 @@ again:
RSSI = perform(break_on_operation, i, frequencies[i], setting.tracking); RSSI = perform(break_on_operation, i, frequencies[i], setting.tracking);
// back to toplevel to handle ui operation if ( setting.sweep_time > 0 && !(MODE_OUTPUT(setting.mode) && setting.modulation != MO_NONE)) {
if (operation_requested && break_on_operation)
return false;
if (MODE_OUTPUT(setting.mode)) {
if (setting.modulation == MO_NONE) {
int32_t s = setting.sweep_time * (100000 / 290); int32_t s = setting.sweep_time * (100000 / 290);
if (s < 30000) if (s < 30000)
my_microsecond_delay(s); my_microsecond_delay(s);
else else
osalThreadSleepMilliseconds(s/1000); osalThreadSleepMilliseconds(s/1000);
} }
// back to toplevel to handle ui operation
if ((operation_requested || shell_function) && break_on_operation)
return false;
if (MODE_OUTPUT(setting.mode)) {
continue; // Skip all other processing continue; // Skip all other processing
} }
if (MODE_INPUT(setting.mode)) { if (MODE_INPUT(setting.mode)) {
temp_t[i] = RSSI; temp_t[i] = RSSI;
@ -1761,7 +1767,7 @@ void draw_cal_status(void)
ili9341_drawstring("Scan:", x, y); ili9341_drawstring("Scan:", x, y);
y += YSTEP; y += YSTEP;
int32_t t = (int)((2* vbwSteps * sweep_points * ( actualStepDelay / 100) )) /10 int32_t t = ((int32_t)setting.sweep_time)*100 + (int)((2* vbwSteps * sweep_points * ( actualStepDelay / 100) )) /10
#ifdef __SPUR__ #ifdef __SPUR__
* (setting.spur ? 2 : 1) * (setting.spur ? 2 : 1)
#endif #endif

@ -1366,6 +1366,8 @@ static const menuitem_t menu_display[] = {
{ MT_CALLBACK,1, "\2CLEAR\0STORED", menu_storage_cb}, { MT_CALLBACK,1, "\2CLEAR\0STORED", menu_storage_cb},
{ MT_CALLBACK,2, "\2SUBTRACT\0STORED",menu_storage_cb}, { MT_CALLBACK,2, "\2SUBTRACT\0STORED",menu_storage_cb},
{ MT_CALLBACK,3, "WATERFALL", menu_storage_cb}, { MT_CALLBACK,3, "WATERFALL", menu_storage_cb},
{ MT_KEYPAD, KM_SWEEP_TIME, "\2SWEEP\0TIME", NULL},
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_CANCEL, 0, S_LARROW" BACK", NULL },
{ MT_NONE, 0, NULL, NULL } // sentinel { MT_NONE, 0, NULL, NULL } // sentinel
}; };

Loading…
Cancel
Save

Powered by TurnKey Linux.