Selftest and channel line

Removed_REF_marker
erikkaashoek 5 years ago
parent 551a6e48ef
commit 772f84af39

@ -286,6 +286,7 @@ ULIBS = -lm
RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC
include $(RULESPATH)/rules.mk include $(RULESPATH)/rules.mk
#include $(CHIBIOS)/memory.mk
flash: build/ch.bin flash: build/ch.bin
dfu-util -d 0483:df11 -a 0 -s 0x08000000:leave -D build/ch.bin dfu-util -d 0483:df11 -a 0 -s 0x08000000:leave -D build/ch.bin

@ -930,11 +930,13 @@ draw_cell(int m, int n)
for (y = 0; y < h; y++) cell_buffer[y * CELLWIDTH + x] = c; for (y = 0; y < h; y++) cell_buffer[y * CELLWIDTH + x] = c;
} }
#ifdef __CHANNEL_POWER__ #ifdef __CHANNEL_POWER__
c = GET_PALTETTE_COLOR(LCD_BRIGHT_COLOR_GREEN);
if (setting.measurement == M_CP) { if (setting.measurement == M_CP) {
if (x+x0 == WIDTH/3 || x+x0 == 2*WIDTH/3 ) { if (x+x0 == WIDTH/3 || x+x0 == 2*WIDTH/3 ) {
for (y = 0; y < h; y++) cell_buffer[y * CELLWIDTH + x] = LCD_TRIGGER_COLOR; for (y = 0; y < h; y++) cell_buffer[y * CELLWIDTH + x] = c;
} }
} }
c = GET_PALTETTE_COLOR(LCD_GRID_COLOR);
#endif #endif
} }
for (y = 0; y < h; y++) { for (y = 0; y < h; y++) {

@ -2776,7 +2776,7 @@ modulation_again:
if (setting.harmonic && lf > ULTRA_MAX_FREQ) { if (setting.harmonic && lf > ULTRA_MAX_FREQ) {
error_f *= setting.harmonic; error_f *= setting.harmonic;
} }
if (error_f > actual_rbw_x10 * 5) //RBW / 4 // if (error_f > actual_rbw_x10 * 5) //RBW / 4
local_IF += error_f; local_IF += error_f;
} else if ( real_old_freq[ADF4351_LO] < target_f) { } else if ( real_old_freq[ADF4351_LO] < target_f) {
error_f = real_old_freq[ADF4351_LO] - target_f; error_f = real_old_freq[ADF4351_LO] - target_f;
@ -2788,7 +2788,7 @@ modulation_again:
if (setting.harmonic && lf > ULTRA_MAX_FREQ) { if (setting.harmonic && lf > ULTRA_MAX_FREQ) {
error_f *= setting.harmonic; error_f *= setting.harmonic;
} }
if ( error_f < - actual_rbw_x10 * 5) //RBW / 4 // if ( error_f < - actual_rbw_x10 * 5) //RBW / 4
local_IF += error_f; local_IF += error_f;
} }
#endif #endif
@ -3037,7 +3037,7 @@ modulation_again:
pureRSSI = 0; pureRSSI = 0;
else else
pureRSSI = Si446x_RSSI(); pureRSSI = Si446x_RSSI();
//#define __DEBUG_FREQUENCY_SETTING__ #define __DEBUG_FREQUENCY_SETTING__
#ifdef __DEBUG_FREQUENCY_SETTING__ // For debugging the frequency calculation #ifdef __DEBUG_FREQUENCY_SETTING__ // For debugging the frequency calculation
stored_t[i] = -60.0 + (real_old_freq[ADF4351_LO] - f - old_freq[2])/10; stored_t[i] = -60.0 + (real_old_freq[ADF4351_LO] - f - old_freq[2])/10;
#endif #endif
@ -4012,7 +4012,7 @@ const test_case_t test_case [] =
}; };
#else #else
{// Condition Preparation Center Span Pass Width(%)Stop {// Condition Preparation Center Span Pass Width(%)Stop
TEST_CASE_STRUCT(TC_BELOW, TP_SILENT, 0.005, 0.01, 0, 0, 0), // 1 Zero Hz leakage TEST_CASE_STRUCT(TC_BELOW, TP_SILENT, 0.005, 0.01, 10, 0, 0), // 1 Zero Hz leakage
TEST_CASE_STRUCT(TC_BELOW, TP_SILENT, 0.015, 0.01, -30, 0, 0), // 2 Phase noise of zero Hz TEST_CASE_STRUCT(TC_BELOW, TP_SILENT, 0.015, 0.01, -30, 0, 0), // 2 Phase noise of zero Hz
TEST_CASE_STRUCT(TC_SIGNAL, TP_10MHZ, 20, 7, -39, 10, -90), // 3 TEST_CASE_STRUCT(TC_SIGNAL, TP_10MHZ, 20, 7, -39, 10, -90), // 3
TEST_CASE_STRUCT(TC_SIGNAL, TP_10MHZ, 30, 7, -34, 10, -90), // 4 TEST_CASE_STRUCT(TC_SIGNAL, TP_10MHZ, 30, 7, -34, 10, -90), // 4

@ -913,7 +913,6 @@ float Simulated_SI4432_RSSI(uint32_t i, int s)
#endif #endif
//------------------------------- ADF4351 ------------------------------------- //------------------------------- ADF4351 -------------------------------------
#ifdef __ADF4351__
#define bitRead(value, bit) (((value) >> (bit)) & 0x01) #define bitRead(value, bit) (((value) >> (bit)) & 0x01)
#define bitSet(value, bit) ((value) |= (1UL << (bit))) #define bitSet(value, bit) ((value) |= (1UL << (bit)))
@ -1207,11 +1206,13 @@ uint64_t ADF4351_prepare_frequency(int channel, uint64_t freq) // freq / 10Hz
bitWrite (registers[4], 20, 0); bitWrite (registers[4], 20, 0);
} }
volatile uint64_t PFDR = PFDRFout[channel]; volatile uint64_t PFDR = PFDRFout[channel];
INTA = (((uint64_t)freq) * OutputDivider) / PFDR;
MOD = ADF4350_modulo; MOD = ADF4350_modulo;
uint64_t half_spacing = PFDR / MOD / 2 / OutputDivider;
INTA = (((uint64_t)freq + half_spacing) * OutputDivider) / PFDR;
uint64_t f_int = INTA *(uint64_t) MOD; uint64_t f_int = INTA *(uint64_t) MOD;
uint64_t f_target = ((((uint64_t)freq) * OutputDivider) * (uint64_t) MOD) / PFDR; uint64_t f_target = ((((uint64_t)freq + half_spacing) * OutputDivider) * (uint64_t) MOD) / PFDR;
FRAC = f_target - f_int; FRAC = f_target - f_int;
if (FRAC >= MOD) { if (FRAC >= MOD) {
FRAC -= MOD; FRAC -= MOD;
@ -1262,8 +1263,6 @@ uint64_t ADF4351_prepare_frequency(int channel, uint64_t freq) // freq / 10Hz
return actual_freq; return actual_freq;
} }
#endif
void ADF4351_enable(int s) void ADF4351_enable(int s)
{ {
if (s) if (s)

Loading…
Cancel
Save

Powered by TurnKey Linux.