kopia lustrzana https://github.com/mikaelnousiainen/RS41ng
fix GPS and revert some settings
rodzic
f71ef21f53
commit
2a9060bba6
|
@ -38,8 +38,9 @@ static inline void cats_push_u16(cats_packet *p, uint16_t val)
|
|||
}
|
||||
}
|
||||
|
||||
static inline void cats_push_i32(cats_packet *p, int32_t val)
|
||||
static inline void cats_push_u32(cats_packet *p, uint32_t val)
|
||||
{
|
||||
|
||||
for(int i = 0; i < 4; i++) {
|
||||
p->data[p->len++] = val >> (i * 8);
|
||||
}
|
||||
|
@ -61,11 +62,13 @@ void cats_append_gps_whisker(cats_packet *packet, gps_data gps)
|
|||
{
|
||||
packet->data[packet->len++] = 0x02; // type = gps
|
||||
packet->data[packet->len++] = 14; // len
|
||||
cats_push_i32(packet, gps.latitude_degrees_1000000 / 90 * ((1<<31) / 1000000)); // lat
|
||||
cats_push_i32(packet, gps.longitude_degrees_1000000 / 180 * ((1<<31) / 1000000)); // lon
|
||||
cats_push_f16(packet, gps.altitude_mm / 100.0); // alt
|
||||
int32_t lat_converted = gps.latitude_degrees_1000000 * (1LL<<31) / 90LL / 10000000LL;
|
||||
int32_t lon_converted = gps.longitude_degrees_1000000 * (1LL<<31) / 180LL / 10000000LL;
|
||||
cats_push_u32(packet, lat_converted); // lat
|
||||
cats_push_u32(packet, lon_converted); // lon
|
||||
cats_push_f16(packet, gps.altitude_mm / 1000.0); // alt
|
||||
packet->data[packet->len++] = 0; // max error = 0m
|
||||
packet->data[packet->len++] = gps.heading_degrees_100000 * 128 / 180 / 100000; // heading
|
||||
packet->data[packet->len++] = gps.heading_degrees_100000 / 100000.0 * 128.0 / 180.0; // heading
|
||||
cats_push_f16(packet, gps.ground_speed_cm_per_second / 100.0); // horizontal speed
|
||||
}
|
||||
|
||||
|
|
18
src/config.h
18
src/config.h
|
@ -21,15 +21,15 @@
|
|||
// Enable semihosting to receive debug logs during development
|
||||
// See the README for details on how to set up debugging and debug logs with GDB
|
||||
// NOTE: Semihosting has to be disabled when the radiosonde is not connected to an STM32 programmer dongle, otherwise the firmware will not run.
|
||||
#define SEMIHOSTING_ENABLE
|
||||
#define LOGGING_ENABLE
|
||||
//#define SEMIHOSTING_ENABLE
|
||||
//#define LOGGING_ENABLE
|
||||
|
||||
/**
|
||||
* Global configuration
|
||||
*/
|
||||
|
||||
// Set the tracker amateur radio call sign here
|
||||
#define CALLSIGN "VE9QLE"
|
||||
#define CALLSIGN "MYCALL"
|
||||
|
||||
// Disabling LEDs will save power
|
||||
// Red LED: Lit during initialization and transmit.
|
||||
|
@ -182,13 +182,13 @@
|
|||
#define RADIO_SI4063_TX_CW_COUNT 1
|
||||
#define RADIO_SI4063_TX_PIP false
|
||||
#define RADIO_SI4063_TX_PIP_COUNT 6
|
||||
#define RADIO_SI4063_TX_APRS false
|
||||
#define RADIO_SI4063_TX_APRS true
|
||||
#define RADIO_SI4063_TX_APRS_COUNT 2
|
||||
#define RADIO_SI4063_TX_HORUS_V1 false
|
||||
#define RADIO_SI4063_TX_HORUS_V1_COUNT 1
|
||||
#define RADIO_SI4063_TX_HORUS_V2 false
|
||||
#define RADIO_SI4063_TX_HORUS_V2_COUNT 6
|
||||
#define RADIO_SI4063_TX_CATS true
|
||||
#define RADIO_SI4063_TX_CATS false
|
||||
#define RADIO_SI4063_TX_CATS_COUNT 1
|
||||
|
||||
// Continuous transmit mode can be enabled for *either* Horus V1 or V2, but not both. This disables all other transmission modes.
|
||||
|
@ -203,8 +203,8 @@
|
|||
#define RADIO_SI4063_TX_FREQUENCY_APRS_1200 432500000
|
||||
// Use a frequency offset to place FSK tones slightly above the defined frequency for SSB reception
|
||||
#define RADIO_SI4063_TX_FREQUENCY_HORUS_V1 432501000
|
||||
#define RADIO_SI4063_TX_FREQUENCY_HORUS_V2 434500000
|
||||
#define RADIO_SI4063_TX_FREQUENCY_CATS 434500000
|
||||
#define RADIO_SI4063_TX_FREQUENCY_HORUS_V2 432501000
|
||||
#define RADIO_SI4063_TX_FREQUENCY_CATS 430500000
|
||||
|
||||
/**
|
||||
* RS41 only: External Si5351 radio chip transmission configuration
|
||||
|
@ -342,8 +342,8 @@
|
|||
* CATS mode settings
|
||||
*/
|
||||
#define CATS_CALLSIGN CALLSIGN
|
||||
#define CATS_SSID 24
|
||||
#define CATS_ICON 8237
|
||||
#define CATS_SSID 29 // 0 - 255
|
||||
#define CATS_ICON 13 // Balloon. See the CATS standard for more options
|
||||
#define CATS_COMMENT "I am a radiosonde. Hear me meow!"
|
||||
#define CATS_REPORTED_TX_POWER_DBM 20
|
||||
|
||||
|
|
|
@ -260,7 +260,7 @@ uint16_t si4063_start_tx(uint8_t *data, int len)
|
|||
// If less than len, you will need to keep calling this
|
||||
uint16_t si4063_refill_buffer(uint8_t *data, int len)
|
||||
{
|
||||
uint8_t response[2];
|
||||
uint8_t response[2] = {0, 0};
|
||||
|
||||
// Check how many bytes we have free
|
||||
si4063_send_command(SI4063_COMMAND_FIFO_INFO, 0, NULL);
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#define log_error printf
|
||||
#define log_warn printf
|
||||
#define log_info printf
|
||||
#define log_debug printf
|
||||
#define log_debug(...)
|
||||
#define log_trace(...)
|
||||
|
||||
#else
|
||||
|
|
|
@ -981,7 +981,7 @@ void radio_handle_main_loop()
|
|||
log_info("Lat: %ld *1M, Lon: %ld *1M, Alt: %ld m\n",
|
||||
current_telemetry_data.gps.latitude_degrees_1000000 / 10,
|
||||
current_telemetry_data.gps.longitude_degrees_1000000 / 10,
|
||||
(current_telemetry_data.gps.altitude_mm / 1000) * 3280 / 1000);
|
||||
(current_telemetry_data.gps.altitude_mm / 1000));
|
||||
#endif
|
||||
|
||||
radio_reset_transmit_delay_counter();
|
||||
|
|
Ładowanie…
Reference in New Issue