Various small improvements

tinySA
erikkaashoek 6 years ago
parent 8bd2b4f899
commit 46e09bc8fa

@ -5,8 +5,8 @@
# Compiler options here. # Compiler options here.
ifeq ($(USE_OPT),) ifeq ($(USE_OPT),)
USE_OPT = -O2 -fno-inline-small-functions -ggdb -fomit-frame-pointer -falign-functions=16 --specs=nano.specs -fstack-usage # USE_OPT = -O2 -fno-inline-small-functions -ggdb -fomit-frame-pointer -falign-functions=16 --specs=nano.specs -fstack-usage
# USE_OPT = -fno-inline-small-functions -ggdb -fomit-frame-pointer -falign-functions=16 --specs=nano.specs -fstack-usage USE_OPT = -fno-inline-small-functions -ggdb -fomit-frame-pointer -falign-functions=16 --specs=nano.specs -fstack-usage
endif endif
# C specific options here (added to USE_OPT). # C specific options here (added to USE_OPT).

@ -1,8 +1,8 @@
// ---------------------------------------------------
#include "SI4432.h" // comment out for simulation #include "SI4432.h" // comment out for simulation
int setting_mode = M_LOW; int setting_mode = -1; // To force initialzation
int dirty = true; int dirty = true;
@ -152,7 +152,7 @@ int GetMode(void)
#define POWER_STEP 0 // Should be 5 dB but appearently it is lower #define POWER_STEP 0 // Should be 5 dB but appearently it is lower
#define POWER_OFFSET 12 #define POWER_OFFSET 20
#define SWITCH_ATTENUATION 29 #define SWITCH_ATTENUATION 29
int GetAttenuation(void) int GetAttenuation(void)
@ -170,7 +170,7 @@ int GetAttenuation(void)
void SetAttenuation(int a) void SetAttenuation(int a)
{ {
if (setting_mode == M_GENLOW) { if (setting_mode == M_GENLOW) {
setting_drive = 0; setting_drive = 8; // Start at lowest drive level;
a = a + POWER_OFFSET; a = a + POWER_OFFSET;
if (a > 0) { if (a > 0) {
setting_drive++; setting_drive++;
@ -385,9 +385,9 @@ void SetMode(int m)
void apply_settings(void) void apply_settings(void)
{ {
if (setting_step_delay == 0){ if (setting_step_delay == 0){
if (actual_rbw >142.0) actualStepDelay = 350; if (actual_rbw >142.0) actualStepDelay = 450;
else if (actual_rbw > 75.0) actualStepDelay = 450; else if (actual_rbw > 75.0) actualStepDelay = 550;
else if (actual_rbw > 56.0) actualStepDelay = 600; else if (actual_rbw > 56.0) actualStepDelay = 650;
else if (actual_rbw > 37.0) actualStepDelay = 800; else if (actual_rbw > 37.0) actualStepDelay = 800;
else if (actual_rbw > 18.0) actualStepDelay = 1100; else if (actual_rbw > 18.0) actualStepDelay = 1100;
else if (actual_rbw > 9.0) actualStepDelay = 2000; else if (actual_rbw > 9.0) actualStepDelay = 2000;

@ -528,10 +528,10 @@ const char *menu_drive_text[]={"-30dBm","-27dBm","-24dBm","-21dBm","-18dBm","-15
// ===[MENU DEFINITION]========================================================= // ===[MENU DEFINITION]=========================================================
static const menuitem_t menu_drive[] = { static const menuitem_t menu_drive[] = {
{ MT_CALLBACK, 7, " 20dBm", menu_drive_cb}, { MT_CALLBACK, 15, " 20dBm", menu_drive_cb},
{ MT_CALLBACK, 6, " 16dBm", menu_drive_cb}, { MT_CALLBACK, 14, " 16dBm", menu_drive_cb},
{ MT_CALLBACK, 5, " 12dBm", menu_drive_cb}, { MT_CALLBACK, 13, " 12dBm", menu_drive_cb},
{ MT_CALLBACK, 4, " 8dBm", menu_drive_cb}, { MT_CALLBACK, 12, " 8dBm", menu_drive_cb},
{ MT_CANCEL, 255, S_LARROW" BACK", NULL }, { MT_CANCEL, 255, S_LARROW" BACK", NULL },
{ MT_NONE, 0, NULL, NULL } // sentinel { MT_NONE, 0, NULL, NULL } // sentinel
}; };

Loading…
Cancel
Save

Powered by TurnKey Linux.