5959#define SHORT_WAIT_INTERVAL 100
6060#define DEFAULT_WAIT_INTERVAL 1000
6161
62+ #define USB_CONFIGURATION_BLINK 400
63+
6264/* SRAM buffer constants */
6365
6466#define NUMBER_OF_BUFFERS 8
@@ -570,11 +572,11 @@ static void setHeaderComment(wavHeader_t *wavHeader, configSettings_t *configSet
570572
571573 }
572574
573- char * sign = temperature < 0 ? "-" : "" ;
575+ char * temperatureSign = temperature < 0 ? "-" : "" ;
574576
575577 uint32_t temperatureInDecidegrees = ROUNDED_DIV (ABS (temperature ), 100 );
576578
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 );
578580
579581 bool frequencyTriggerEnabled = configSettings -> enableFrequencyTrigger ;
580582
@@ -708,17 +710,21 @@ static uint32_t writeGuanoData(char *buffer, configSettings_t *configSettings, u
708710
709711 int32_t longitude = * gpsLocationReceived ? * gpsLastFixLongitude : * acousticLocationReceived ? * acousticLongitude : configSettings -> longitude ;
710712
713+ char * latitudeSign = latitude < 0 ? "-" : "" ;
714+
715+ char * longitudeSign = longitude < 0 ? "-" : "" ;
716+
711717 if (* gpsLocationReceived ) {
712718
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 );
714720
715721 } else if (* acousticLocationReceived ) {
716722
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 );
718724
719725 } else {
720726
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 );
722728
723729 }
724730
@@ -732,11 +738,11 @@ static uint32_t writeGuanoData(char *buffer, configSettings_t *configSettings, u
732738
733739 length += sprintf (buffer + length , "OAD|Battery Voltage:%01lu.%01lu\n" , batteryVoltage / 10 , batteryVoltage % 10 );
734740
735- char * sign = temperature < 0 ? "-" : "" ;
741+ char * temperatureSign = temperature < 0 ? "-" : "" ;
736742
737743 uint32_t temperatureInDecidegrees = ROUNDED_DIV (ABS (temperature ), 100 );
738744
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 );
740746
741747 * (uint32_t * )(buffer + RIFF_ID_LENGTH ) = length - sizeof (chunk_t );;
742748
@@ -1243,7 +1249,7 @@ static int16_t secondaryBuffer[MAXIMUM_SAMPLES_IN_DMA_TRANSFER];
12431249
12441250/* Firmware version and description */
12451251
1246- static uint8_t firmwareVersion [AM_FIRMWARE_VERSION_LENGTH ] = {1 , 10 , 0 };
1252+ static uint8_t firmwareVersion [AM_FIRMWARE_VERSION_LENGTH ] = {1 , 10 , 1 };
12471253
12481254static uint8_t firmwareDescription [AM_FIRMWARE_DESCRIPTION_LENGTH ] = "AudioMoth-Firmware-Basic" ;
12491255
@@ -2481,6 +2487,10 @@ inline void AudioMoth_usbApplicationPacketReceived(uint32_t messageType, uint8_t
24812487
24822488 AudioMoth_setTime (configSettings -> time , USB_CONFIG_TIME_CORRECTION );
24832489
2490+ /* Blink the green LED */
2491+
2492+ AudioMoth_blinkDuringUSB (USB_CONFIGURATION_BLINK );
2493+
24842494 } else {
24852495
24862496 /* Return blank configuration as error indicator */
0 commit comments