kopia lustrzana https://github.com/Qyon/STM32_RTTY
Temperature and voltage in APRS frame (as comment!)
rodzic
3d97565ace
commit
c8d09f11d5
9
aprs.cpp
9
aprs.cpp
|
@ -39,7 +39,7 @@ void calcDMH(long x, int8_t* degrees, uint8_t* minutes, uint8_t* h_minutes) {
|
|||
}
|
||||
}
|
||||
|
||||
void aprs_send_position(GPSEntry gpsData) {
|
||||
void aprs_send_position(GPSEntry gpsData, int8_t temperature, uint16_t voltage) {
|
||||
char packet_buffer[128];
|
||||
int8_t la_degrees, lo_degrees;
|
||||
uint8_t la_minutes, la_h_minutes, lo_minutes, lo_h_minutes;
|
||||
|
@ -51,14 +51,17 @@ void aprs_send_position(GPSEntry gpsData) {
|
|||
aprs_packet_counter ++;
|
||||
|
||||
sprintf(packet_buffer,
|
||||
("!%02d%02d.%02u%c/%03d%02u.%02u%cO/A=%06ld/%d,%d"),
|
||||
("!%02d%02d.%02u%c/%03d%02u.%02u%cO/A=%06ld/P%dS%dT%dV%d Hello from the sky!"),
|
||||
abs(la_degrees), la_minutes, la_h_minutes,
|
||||
la_degrees > 0 ? 'N' : 'S',
|
||||
abs(lo_degrees), lo_minutes, lo_h_minutes,
|
||||
lo_degrees > 0 ? 'E' : 'W',
|
||||
(gpsData.alt_raw/1000) * 3280 / 1000,
|
||||
aprs_packet_counter,
|
||||
gpsData.sats_raw);
|
||||
gpsData.sats_raw,
|
||||
temperature,
|
||||
voltage
|
||||
);
|
||||
qaprs.sendData(packet_buffer);
|
||||
}
|
||||
|
||||
|
|
2
aprs.h
2
aprs.h
|
@ -15,7 +15,7 @@ extern "C" {
|
|||
void aprs_init();
|
||||
void aprs_timer_handler();
|
||||
uint8_t aprs_is_active();
|
||||
void aprs_send_position(GPSEntry gpsData);
|
||||
void aprs_send_position(GPSEntry gpsData, int8_t temperature, uint16_t voltage);
|
||||
void aprs_change_tone_time(uint16_t x);
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
|
|
4
main.c
4
main.c
|
@ -185,7 +185,9 @@ int main(void) {
|
|||
GPSEntry gpsData;
|
||||
ublox_get_last_data(&gpsData);
|
||||
USART_Cmd(USART1, DISABLE);
|
||||
aprs_send_position(gpsData);
|
||||
int8_t temperature = radio_read_temperature();
|
||||
uint16_t voltage = (uint16_t) srednia(ADCVal[0] * 600 / 4096);
|
||||
aprs_send_position(gpsData, temperature, voltage);
|
||||
USART_Cmd(USART1, ENABLE);
|
||||
radio_disable_tx();
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue