Skip to content

Commit 340a370

Browse files
committed
Release v2.5.2
1 parent 0155da3 commit 340a370

6 files changed

+49
-50
lines changed

CHANGELOG.md

+13
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [v2.5.2] - v2.5.2
8+
9+
### Fixed
10+
11+
- Fix Wi-Fi math computation warnings
12+
13+
## [v2.5.1] 2024-10-31
14+
15+
### Fixed
16+
17+
- In-code driver version
18+
- Fix RTToF and GNSS math computation warnings
19+
720
## [v2.5.0] 2024-07-24
821

922
### Added

src/lr11xx_driver_version.c

+1-7
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,6 @@
4444
* --- PRIVATE MACROS-----------------------------------------------------------
4545
*/
4646

47-
#define STR_HELPER( x ) #x
48-
#define STR( x ) STR_HELPER( x )
49-
50-
#define LR11XX_DRIVER_VERSION_FULL \
51-
"v" STR( LR11XX_DRIVER_VERSION_MAJOR ) "." STR( LR11XX_DRIVER_VERSION_MINOR ) "." STR( LR11XX_DRIVER_VERSION_PATCH )
52-
5347
/*
5448
* -----------------------------------------------------------------------------
5549
* --- PRIVATE CONSTANTS -------------------------------------------------------
@@ -77,7 +71,7 @@
7771

7872
const char* lr11xx_driver_version_get_version_string( void )
7973
{
80-
return ( const char* ) LR11XX_DRIVER_VERSION_FULL;
74+
return ( const char* ) LR11XX_DRIVER_VERSION;
8175
}
8276

8377
/*

src/lr11xx_driver_version.h

+4-12
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ extern "C" {
5454
* --- PUBLIC CONSTANTS --------------------------------------------------------
5555
*/
5656

57-
#define LR11XX_DRIVER_VERSION_MAJOR 2
58-
#define LR11XX_DRIVER_VERSION_MINOR 4
59-
#define LR11XX_DRIVER_VERSION_PATCH 1
57+
#define LR11XX_DRIVER_VERSION "v2.5.2"
6058

6159
/*
6260
* -----------------------------------------------------------------------------
@@ -68,17 +66,11 @@ extern "C" {
6866
* --- PUBLIC FUNCTIONS PROTOTYPES ---------------------------------------------
6967
*/
7068

71-
/*!
72-
* @brief Compare version information with current ones
69+
/**
70+
* @brief Get version of driver as string
7371
*
74-
* This macro expands to true boolean value if the version information provided in argument is compatible or
75-
* retro-compatible with the version of this code base
72+
* @return String describing driver version
7673
*/
77-
#define LR11XX_DRIVER_VERSION_CHECK( x, y, z ) \
78-
( x == LR11XX_DRIVER_VERSION_MAJOR && \
79-
( y < LR11XX_DRIVER_VERSION_MINOR || \
80-
( y == LR11XX_DRIVER_VERSION_MINOR && z <= LR11XX_DRIVER_VERSION_PATCH ) ) )
81-
8274
const char* lr11xx_driver_version_get_version_string( void );
8375

8476
#ifdef __cplusplus

src/lr11xx_gnss.c

+27-27
Original file line numberDiff line numberDiff line change
@@ -970,37 +970,37 @@ void lr11xx_gnss_compute_power_consumption(
970970
uint32_t* power_consumption_nah, uint32_t* power_consumption_nwh )
971971
{
972972
float e_init =
973-
( ( float ) instantaneous_power_consumption_ua->init_ua / 1000.0 * ( float ) cumulative_timing->init ) /
974-
32768.0;
973+
( ( float ) instantaneous_power_consumption_ua->init_ua / 1000.0f * ( float ) cumulative_timing->init ) /
974+
32768.0f;
975975

976-
float e_gps_capture = ( ( ( float ) instantaneous_power_consumption_ua->phase1_gps_capture_ua / 1000.0 *
976+
float e_gps_capture = ( ( ( float ) instantaneous_power_consumption_ua->phase1_gps_capture_ua / 1000.0f *
977977
( float ) cumulative_timing->phase1_gps_capture ) +
978-
( ( float ) instantaneous_power_consumption_ua->multiscan_gps_capture_ua / 1000.0 *
978+
( ( float ) instantaneous_power_consumption_ua->multiscan_gps_capture_ua / 1000.0f *
979979
( float ) cumulative_timing->multiscan_gps_capture ) ) /
980-
32768.0;
980+
32768.0f;
981981

982-
float e_gps_process = ( ( ( float ) instantaneous_power_consumption_ua->phase1_gps_process_ua / 1000.0 *
982+
float e_gps_process = ( ( ( float ) instantaneous_power_consumption_ua->phase1_gps_process_ua / 1000.0f *
983983
( float ) cumulative_timing->phase1_gps_process ) +
984-
( ( float ) instantaneous_power_consumption_ua->multiscan_gps_process_ua / 1000.0 *
984+
( ( float ) instantaneous_power_consumption_ua->multiscan_gps_process_ua / 1000.0f *
985985
( float ) cumulative_timing->multiscan_gps_process ) ) /
986-
32768.0;
986+
32768.0f;
987987

988-
float e_gps_sleep_32k = ( ( float ) instantaneous_power_consumption_ua->sleep_32k_ua / 1000.0 *
988+
float e_gps_sleep_32k = ( ( float ) instantaneous_power_consumption_ua->sleep_32k_ua / 1000.0f *
989989
( float ) cumulative_timing->multiscan_gps_sleep_32k ) /
990-
32768.0;
990+
32768.0f;
991991

992992
float e_tot_gps = e_gps_capture + e_gps_process + e_gps_sleep_32k;
993993

994-
float e_beidou_capture = ( ( ( float ) instantaneous_power_consumption_ua->phase1_beidou_capture_ua / 1000.0 *
994+
float e_beidou_capture = ( ( ( float ) instantaneous_power_consumption_ua->phase1_beidou_capture_ua / 1000.0f *
995995
( float ) cumulative_timing->phase1_beidou_capture ) +
996-
( ( float ) instantaneous_power_consumption_ua->multiscan_beidou_capture_ua / 1000.0 *
996+
( ( float ) instantaneous_power_consumption_ua->multiscan_beidou_capture_ua / 1000.0f *
997997
( float ) cumulative_timing->multiscan_beidou_capture ) ) /
998-
32768.0;
999-
float e_beidou_process = ( ( ( float ) instantaneous_power_consumption_ua->phase1_beidou_process_ua / 1000.0 *
998+
32768.0f;
999+
float e_beidou_process = ( ( ( float ) instantaneous_power_consumption_ua->phase1_beidou_process_ua / 1000.0f *
10001000
( float ) cumulative_timing->phase1_beidou_process ) +
1001-
( ( float ) instantaneous_power_consumption_ua->multiscan_beidou_process_ua / 1000.0 *
1001+
( ( float ) instantaneous_power_consumption_ua->multiscan_beidou_process_ua / 1000.0f *
10021002
( float ) cumulative_timing->multiscan_beidou_process ) ) /
1003-
32768.0;
1003+
32768.0f;
10041004
float e_beidou_sleep_32k =
10051005
( instantaneous_power_consumption_ua->sleep_32k_ua / 1000.0 * cumulative_timing->multiscan_beidou_sleep_32k ) /
10061006
32768.0;
@@ -1010,31 +1010,31 @@ void lr11xx_gnss_compute_power_consumption(
10101010
float e_demod = 0;
10111011
if( cumulative_timing->constellation_demod == 0 ) // Demodulation has been done on GPS constellation
10121012
{
1013-
e_demod = ( ( ( float ) instantaneous_power_consumption_ua->multiscan_gps_capture_ua / 1000.0 *
1013+
e_demod = ( ( ( float ) instantaneous_power_consumption_ua->multiscan_gps_capture_ua / 1000.0f *
10141014
( float ) cumulative_timing->demod_capture ) +
1015-
( ( float ) instantaneous_power_consumption_ua->multiscan_gps_process_ua / 1000.0 *
1015+
( ( float ) instantaneous_power_consumption_ua->multiscan_gps_process_ua / 1000.0f *
10161016
( float ) cumulative_timing->demod_process ) +
1017-
( ( float ) instantaneous_power_consumption_ua->sleep_32k_ua / 1000.0 *
1017+
( ( float ) instantaneous_power_consumption_ua->sleep_32k_ua / 1000.0f *
10181018
( float ) cumulative_timing->demod_sleep_32k ) +
1019-
( ( float ) instantaneous_power_consumption_ua->demod_sleep_32m_ua / 1000.0 *
1019+
( ( float ) instantaneous_power_consumption_ua->demod_sleep_32m_ua / 1000.0f *
10201020
( float ) cumulative_timing->demod_sleep_32m ) ) /
1021-
32768.0;
1021+
32768.0f;
10221022
}
10231023
else // Domulation has been done on Beidou constellation
10241024
{
1025-
e_demod = ( ( ( float ) instantaneous_power_consumption_ua->multiscan_beidou_capture_ua / 1000.0 *
1025+
e_demod = ( ( ( float ) instantaneous_power_consumption_ua->multiscan_beidou_capture_ua / 1000.0f *
10261026
( float ) cumulative_timing->demod_capture ) +
1027-
( ( float ) instantaneous_power_consumption_ua->multiscan_beidou_process_ua / 1000.0 *
1027+
( ( float ) instantaneous_power_consumption_ua->multiscan_beidou_process_ua / 1000.0f *
10281028
( float ) cumulative_timing->demod_process ) +
1029-
( ( float ) instantaneous_power_consumption_ua->sleep_32k_ua / 1000.0 *
1029+
( ( float ) instantaneous_power_consumption_ua->sleep_32k_ua / 1000.0f *
10301030
( float ) cumulative_timing->demod_sleep_32k ) +
1031-
( ( float ) instantaneous_power_consumption_ua->demod_sleep_32m_ua / 1000.0 *
1031+
( ( float ) instantaneous_power_consumption_ua->demod_sleep_32m_ua / 1000.0f *
10321032
( float ) cumulative_timing->demod_sleep_32m ) ) /
1033-
32768.0;
1033+
32768.0f;
10341034
}
10351035

10361036
float power_consumption_uah_tmp = ( ( e_init + e_tot_gps + e_tot_beidou + e_demod ) * 1000 ) /
1037-
( 3600.0 - ( ( float ) cumulative_timing->total / 32768.0 ) );
1037+
( 3600.0f - ( ( float ) cumulative_timing->total / 32768.0f ) );
10381038

10391039
*power_consumption_nah = ( uint32_t )( power_consumption_uah_tmp * 1000 );
10401040
*power_consumption_nwh =

src/lr11xx_rttof.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ int32_t lr11xx_rttof_distance_raw_to_meter( lr11xx_radio_lora_bw_t rttof_bw,
178178
}
179179

180180
int32_t retval = raw_distance;
181-
if( raw_distance >= ( 1 << ( bitcnt - 1 ) ) )
181+
if( raw_distance >= (uint32_t)( 1 << ( bitcnt - 1 ) ) )
182182
{
183183
retval -= ( 1 << bitcnt );
184184
}

src/lr11xx_wifi.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -567,13 +567,13 @@ uint32_t lr11xx_wifi_get_consumption_nah( lr11xx_system_reg_mode_t regulator, lr
567567
( ( float ) timing.demodulation_us * LR11XX_WIFI_DEMODULATION_NA ) +
568568
( ( float ) timing.rx_correlation_us * LR11XX_WIFI_CORRELATION_NA );
569569

570-
wifi_scan_consumption_nah = wifi_scan_consumption_nah /
571-
( 3600000000.0 - ( ( float ) timing.rx_capture_us + ( float ) timing.demodulation_us +
570+
wifi_scan_consumption_nah = (float) wifi_scan_consumption_nah /
571+
( (float) 3600000000.0 - ( ( float ) timing.rx_capture_us + ( float ) timing.demodulation_us +
572572
( float ) timing.rx_correlation_us ) );
573573

574574
if( regulator == LR11XX_SYSTEM_REG_MODE_LDO )
575575
{
576-
wifi_scan_consumption_nah *= 2.0;
576+
wifi_scan_consumption_nah *= (float) 2.0;
577577
}
578578

579579
return ( uint32_t ) wifi_scan_consumption_nah;

0 commit comments

Comments
 (0)