Tuned 300 baud settings

This commit is contained in:
Mark Qvist 2019-04-05 13:26:53 +02:00
parent 16e989c680
commit 1c2d1b484b
5 changed files with 25 additions and 69 deletions

View file

@ -120,8 +120,8 @@ inline static uint8_t sinSample(uint16_t i) {
#endif
#if BITRATE == 300
#define DCD_TIMEOUT_SAMPLES 520
#define DCD_MIN_COUNT 2
#define DCD_TIMEOUT_SAMPLES 512
#define DCD_MIN_COUNT 4
#elif BITRATE == 1200
#define DCD_TIMEOUT_SAMPLES CONFIG_ADC_SAMPLERATE/100
#define DCD_MIN_COUNT CONFIG_ADC_SAMPLERATE/1600
@ -177,7 +177,7 @@ typedef struct Afsk
uint16_t phaseAcc; // Phase accumulator
uint16_t phaseInc; // Phase increment per sample
uint16_t silentSamples; // How many samples were completely silent
uint16_t silentSamples; // How many samples were silent
volatile bool sending; // Set when modem is sending
volatile bool sending_data; // Set when modem is sending data
@ -208,7 +208,7 @@ typedef struct Afsk
#else
#error Not enough space in sampledBits variable!
#endif
int16_t currentPhase; // Current phase of the demodulator
int16_t currentPhase; // Current phase of the demodulator
uint8_t actualBits; // Actual found bits at correct bitrate
volatile int status; // Status of the modem, 0 means OK

View file

@ -191,23 +191,20 @@ void gps_nmea_parse(uint8_t sentence_length) {
gps_lon *= (gps_lon_sign == 'E' ? 1 : -1);
// TODO: Remove this
// if (gps_fix) {
// printf("GPS fix: %d\r\n", nmea_fix);
// printf("GPS satellites: %d\r\n", gps_sats);
// printf("GPS latitude: %d\" %d' %.2fs %c\r\n", gps_lat_degrees, gps_lat_minutes, gps_lat_seconds, gps_lat_sign);
// printf("GPS longtitude: %d\" %d' %.2fs %c\r\n", gps_lon_degrees, gps_lon_minutes, gps_lon_seconds, gps_lon_sign);
// printf("GPS coords: %.6f,%.6f\r\n", gps_lat, gps_lon);
// printf("GPS speed %.2f Km/h\r\n", gps_speed_kmh);
// printf("GPS speed %.2f knots\r\n", gps_speed_knots);
// printf("GPS bearing %.2f\r\n", gps_bearing);
// printf("GPS height above MSL: %.2f\r\n", gps_height_above_msl);
// printf("GPS altitude: %.2f\r\n", gps_altitude);
// printf("GPS geoid height: %.2f\r\n", gps_geoid_height);
// printf("GPS HDOP: %.2f\r\n", gps_hdop);
// printf("GPS time %d:%d:%d UTC\r\n", gps_t_hour, gps_t_minute, gps_t_second);
// } else {
// printf("No GPS fix");
// }
// printf("GPS fix: %d\r\n", nmea_fix);
// printf("GPS satellites: %d\r\n", gps_sats);
// printf("GPS latitude: %d\" %d' %.2fs %c\r\n", gps_lat_degrees, gps_lat_minutes, gps_lat_seconds, gps_lat_sign);
// printf("GPS longtitude: %d\" %d' %.2fs %c\r\n", gps_lon_degrees, gps_lon_minutes, gps_lon_seconds, gps_lon_sign);
// printf("GPS coords: %.6f,%.6f\r\n", gps_lat, gps_lon);
// printf("GPS speed %.2f Km/h\r\n", gps_speed_kmh);
// printf("GPS speed %.2f knots\r\n", gps_speed_knots);
// printf("GPS bearing %.2f\r\n", gps_bearing);
// printf("GPS height above MSL: %.2f\r\n", gps_height_above_msl);
// printf("GPS altitude: %.2f\r\n", gps_altitude);
// printf("GPS geoid height: %.2f\r\n", gps_geoid_height);
// printf("GPS HDOP: %.2f\r\n", gps_hdop);
// printf("GPS time %d:%d:%d UTC\r\n", gps_t_hour, gps_t_minute, gps_t_second);
}
}

View file

@ -19,7 +19,7 @@ void VREF_init(void) {
void vref_setADC(uint8_t value) {
config_input_gain = value;
OCR2A = config_input_gain;
OCR2A = 0xFF - config_input_gain;
}
void vref_setDAC(uint8_t value) {