59
59
#define SHORT_WAIT_INTERVAL 100
60
60
#define DEFAULT_WAIT_INTERVAL 1000
61
61
62
+ #define USB_CONFIGURATION_BLINK 400
63
+
62
64
/* SRAM buffer constants */
63
65
64
66
#define NUMBER_OF_BUFFERS 8
@@ -570,11 +572,11 @@ static void setHeaderComment(wavHeader_t *wavHeader, configSettings_t *configSet
570
572
571
573
}
572
574
573
- char * sign = temperature < 0 ? "-" : "" ;
575
+ char * temperatureSign = temperature < 0 ? "-" : "" ;
574
576
575
577
uint32_t temperatureInDecidegrees = ROUNDED_DIV (ABS (temperature ), 100 );
576
578
577
- comment += sprintf (comment , " and temperature was %s%lu.%luC." , sign , temperatureInDecidegrees / 10 , temperatureInDecidegrees % 10 );
579
+ comment += sprintf (comment , " and temperature was %s%lu.%luC." , temperatureSign , temperatureInDecidegrees / 10 , temperatureInDecidegrees % 10 );
578
580
579
581
bool frequencyTriggerEnabled = configSettings -> enableFrequencyTrigger ;
580
582
@@ -708,17 +710,21 @@ static uint32_t writeGuanoData(char *buffer, configSettings_t *configSettings, u
708
710
709
711
int32_t longitude = * gpsLocationReceived ? * gpsLastFixLongitude : * acousticLocationReceived ? * acousticLongitude : configSettings -> longitude ;
710
712
713
+ char * latitudeSign = latitude < 0 ? "-" : "" ;
714
+
715
+ char * longitudeSign = longitude < 0 ? "-" : "" ;
716
+
711
717
if (* gpsLocationReceived ) {
712
718
713
- length += sprintf (buffer + length , "Loc Position:%ld.%06ld %ld.%06ld\nOAD|Loc Source:GPS\n" , latitude / GPS_LOCATION_PRECISION , ABS (latitude ) % GPS_LOCATION_PRECISION , longitude / GPS_LOCATION_PRECISION , ABS (longitude ) % GPS_LOCATION_PRECISION );
719
+ length += sprintf (buffer + length , "Loc Position:%s% ld.%06ld %s% ld.%06ld\nOAD|Loc Source:GPS\n" , latitudeSign , ABS ( latitude ) / GPS_LOCATION_PRECISION , ABS (latitude ) % GPS_LOCATION_PRECISION , longitudeSign , ABS ( longitude ) / GPS_LOCATION_PRECISION , ABS (longitude ) % GPS_LOCATION_PRECISION );
714
720
715
721
} else if (* acousticLocationReceived ) {
716
722
717
- length += sprintf (buffer + length , "Loc Position:%ld.%06ld %ld.%06ld\nOAD|Loc Source:Acoustic chime\n" , latitude / ACOUSTIC_LOCATION_PRECISION , ABS (latitude ) % ACOUSTIC_LOCATION_PRECISION , longitude / ACOUSTIC_LOCATION_PRECISION , ABS (longitude ) % ACOUSTIC_LOCATION_PRECISION );
723
+ length += sprintf (buffer + length , "Loc Position:%s% ld.%06ld %s% ld.%06ld\nOAD|Loc Source:Acoustic chime\n" , latitudeSign , ABS ( latitude ) / ACOUSTIC_LOCATION_PRECISION , ABS (latitude ) % ACOUSTIC_LOCATION_PRECISION , longitudeSign , ABS ( longitude ) / ACOUSTIC_LOCATION_PRECISION , ABS (longitude ) % ACOUSTIC_LOCATION_PRECISION );
718
724
719
725
} else {
720
726
721
- length += sprintf (buffer + length , "Loc Position:%ld.%02ld %ld.%02ld\nOAD|Loc Source:Configuration app\n" , latitude / CONFIG_LOCATION_PRECISION , ABS (latitude ) % CONFIG_LOCATION_PRECISION , longitude / CONFIG_LOCATION_PRECISION , ABS (longitude ) % CONFIG_LOCATION_PRECISION );
727
+ length += sprintf (buffer + length , "Loc Position:%s% ld.%02ld %s% ld.%02ld\nOAD|Loc Source:Configuration app\n" , latitudeSign , ABS ( latitude ) / CONFIG_LOCATION_PRECISION , ABS (latitude ) % CONFIG_LOCATION_PRECISION , longitudeSign , ABS ( longitude ) / CONFIG_LOCATION_PRECISION , ABS (longitude ) % CONFIG_LOCATION_PRECISION );
722
728
723
729
}
724
730
@@ -732,11 +738,11 @@ static uint32_t writeGuanoData(char *buffer, configSettings_t *configSettings, u
732
738
733
739
length += sprintf (buffer + length , "OAD|Battery Voltage:%01lu.%01lu\n" , batteryVoltage / 10 , batteryVoltage % 10 );
734
740
735
- char * sign = temperature < 0 ? "-" : "" ;
741
+ char * temperatureSign = temperature < 0 ? "-" : "" ;
736
742
737
743
uint32_t temperatureInDecidegrees = ROUNDED_DIV (ABS (temperature ), 100 );
738
744
739
- length += sprintf (buffer + length , "Temperature Int:%s%lu.%lu" , sign , temperatureInDecidegrees / 10 , temperatureInDecidegrees % 10 );
745
+ length += sprintf (buffer + length , "Temperature Int:%s%lu.%lu" , temperatureSign , temperatureInDecidegrees / 10 , temperatureInDecidegrees % 10 );
740
746
741
747
* (uint32_t * )(buffer + RIFF_ID_LENGTH ) = length - sizeof (chunk_t );;
742
748
@@ -1243,7 +1249,7 @@ static int16_t secondaryBuffer[MAXIMUM_SAMPLES_IN_DMA_TRANSFER];
1243
1249
1244
1250
/* Firmware version and description */
1245
1251
1246
- static uint8_t firmwareVersion [AM_FIRMWARE_VERSION_LENGTH ] = {1 , 10 , 0 };
1252
+ static uint8_t firmwareVersion [AM_FIRMWARE_VERSION_LENGTH ] = {1 , 10 , 1 };
1247
1253
1248
1254
static uint8_t firmwareDescription [AM_FIRMWARE_DESCRIPTION_LENGTH ] = "AudioMoth-Firmware-Basic" ;
1249
1255
@@ -2481,6 +2487,10 @@ inline void AudioMoth_usbApplicationPacketReceived(uint32_t messageType, uint8_t
2481
2487
2482
2488
AudioMoth_setTime (configSettings -> time , USB_CONFIG_TIME_CORRECTION );
2483
2489
2490
+ /* Blink the green LED */
2491
+
2492
+ AudioMoth_blinkDuringUSB (USB_CONFIGURATION_BLINK );
2493
+
2484
2494
} else {
2485
2495
2486
2496
/* Return blank configuration as error indicator */
0 commit comments