From 7d953cf687d196a9166ff5f6ae6e78497c14c916 Mon Sep 17 00:00:00 2001 From: CInsights Date: Sat, 10 Mar 2018 23:59:50 +1100 Subject: [PATCH] Fix GPS Poll seconds value. Add frequency_setting.txt document. --- .../software/.settings/language.settings.xml | 2 +- tracker/software/config.c | 8 +++---- tracker/software/drivers/ublox.c | 2 +- tracker/software/frequency_setting.txt | 21 +++++++++++++++++++ tracker/software/pkt/devices/si446x.c | 2 +- tracker/software/threads/radio/radio.c | 4 ++++ tracker/software/types.h | 4 ++++ 7 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 tracker/software/frequency_setting.txt diff --git a/tracker/software/.settings/language.settings.xml b/tracker/software/.settings/language.settings.xml index 1180cabe..c9c196c1 100644 --- a/tracker/software/.settings/language.settings.xml +++ b/tracker/software/.settings/language.settings.xml @@ -5,7 +5,7 @@ - + diff --git a/tracker/software/config.c b/tracker/software/config.c index ab8ac1fd..337c7989 100644 --- a/tracker/software/config.c +++ b/tracker/software/config.c @@ -40,7 +40,7 @@ const conf_t conf_flash_default = { .radio_conf = { .pwr = 0x7F, .freq = FREQ_APRS_DYNAMIC, - .step = 12500, + .step = 0, .chan = 0, .mod = MOD_AFSK, .preamble = 200 @@ -64,7 +64,7 @@ const conf_t conf_flash_default = { .radio_conf = { .pwr = 0x7F, .freq = FREQ_APRS_DYNAMIC, - .step = 12500, + .step = 0, .chan = 0, .mod = MOD_AFSK, .preamble = 200, @@ -88,7 +88,7 @@ const conf_t conf_flash_default = { .radio_conf = { .pwr = 0x7F, .freq = FREQ_APRS_DYNAMIC, - .step = 12500, + .step = 0, .chan = 0, .mod = MOD_AFSK, .preamble = 200 @@ -112,7 +112,7 @@ const conf_t conf_flash_default = { .radio_conf = { .pwr = 0x7F, .freq = FREQ_APRS_DYNAMIC, - .step = 12500, + .step = 0, .chan = 0, .mod = MOD_AFSK, .preamble = 200 diff --git a/tracker/software/drivers/ublox.c b/tracker/software/drivers/ublox.c index 1540161d..17713dfe 100644 --- a/tracker/software/drivers/ublox.c +++ b/tracker/software/drivers/ublox.c @@ -237,7 +237,7 @@ bool gps_get_fix(gpsFix_t *fix) { } TRACE_INFO("GPS > Polling OK time=%04d-%02d-%02d %02d:%02d:%02d lat=%d.%05d lon=%d.%05d alt=%dm sats=%d fixOK=%d pDOP=%d.%02d", - fix->time.year, fix->time.month, fix->time.day, fix->time.hour, fix->time.minute, fix->time.day, + fix->time.year, fix->time.month, fix->time.day, fix->time.hour, fix->time.minute, fix->time.second, fix->lat/10000000, (fix->lat > 0 ? 1:-1)*(fix->lat/100)%100000, fix->lon/10000000, (fix->lon > 0 ? 1:-1)*(fix->lon/100)%100000, fix->alt, fix->num_svs, fix->fixOK, fix->pdop/100, fix->pdop%100 ); diff --git a/tracker/software/frequency_setting.txt b/tracker/software/frequency_setting.txt new file mode 100644 index 00000000..fb87e770 --- /dev/null +++ b/tracker/software/frequency_setting.txt @@ -0,0 +1,21 @@ +Why does PP10 have frequency, step and channel parameters in config.c? + +Firstly the ability to specify a frequency directly in the freq parameter of config.c has not changed. +Simply set freq in Hz to a desired frequency and leave step and channel set to 0. +Geofence frequencies remain unaffected as well since step and chan are set to 0 when using geofence. + +Q: So why add step and chan? +A: The addition of step and size is aimed at providing additional functionality in future features as follows... + +A) A table of channels may be specified for scanning/seeking packet signals under software control. + +B) The feature of the Si446x to automatically scan using a channel table is being investigated + - This reduces the amount of control from the host MCU required to manage such a channel scanning application. + - Automatic detection of packet channels would enable operation where GPS location is inactive. + +C) The software base may be used for other than balloon projects or incorporate other bands, protocols and radios + - It can be envisaged that a step and channel format could be useful in such instances. + +D) Configuring the radio(s) won't usually be done by editing config.c directly. + - In over the air or command line configuration changes the UI would not require user knowledge of the structure of config.c + - Some settings may be better described by a band base frequency, a step size and a channel. diff --git a/tracker/software/pkt/devices/si446x.c b/tracker/software/pkt/devices/si446x.c index 4132e06e..1e9a6d99 100644 --- a/tracker/software/pkt/devices/si446x.c +++ b/tracker/software/pkt/devices/si446x.c @@ -58,7 +58,7 @@ static void (*rx_cb)(uint8_t*, uint32_t); static packet_svc_t *packetHandler; -static int16_t Si446x_getTemperature(void); +//static int16_t Si446x_getTemperature(void); /* =================================================================== SPI communication ==================================================================== */ diff --git a/tracker/software/threads/radio/radio.c b/tracker/software/threads/radio/radio.c index 02cabfc1..3dfb1cac 100644 --- a/tracker/software/threads/radio/radio.c +++ b/tracker/software/threads/radio/radio.c @@ -61,6 +61,10 @@ bool transmitOnRadio(packet_t pp, uint32_t freq, uint16_t step, uint8_t chan, chan = 0; } + if(freq == FREQ_APRS_RECEIVE) { + /* TODO: Get current RX frequency (if valid) and use that. */ + } + uint8_t *c; uint32_t len = ax25_get_info(pp, &c); diff --git a/tracker/software/types.h b/tracker/software/types.h index a6210a2b..3e8f5416 100644 --- a/tracker/software/types.h +++ b/tracker/software/types.h @@ -5,6 +5,10 @@ #include "ax25_pad.h" #define FREQ_APRS_DYNAMIC 0 +#define FREQ_APRS_SCAN 1 +#define FREQ_APRS_RECEIVE 2 +#define FREQ_CNC_RECEIVE 3 + #define CYCLE_CONTINUOUSLY 0 #define TYPE_NULL 0