From 8d90c6cffa3e9f9b24a4913923c68233e83d168e Mon Sep 17 00:00:00 2001 From: Anol Paisal Date: Sat, 26 Feb 2022 18:22:26 +0700 Subject: [PATCH] Added marco LSI_VALUE. --- .vscode/settings.json | 7 ++++--- src/apps/LoRaMac/common/Commissioning.h | 2 +- src/boards/SKiM980A/CMakeLists.txt | 2 +- src/boards/SKiM980A/board.c | 14 +++++++------- src/boards/SKiM980A/cmsis/stm32l1xx_hal_conf.h | 9 +++++++++ 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index e3d8b6b7b..e7611a6e7 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -45,12 +45,12 @@ // Target board, the following boards are supported: // NAMote72, NucleoL073 (Default), NucleoL152, NucleoL476, SAMR34, SKiM880B, SKiM980A, SKiM881AXL, eMOD-iMS62F, B-L072Z-LRWAN1. - "BOARD":"eMOD-iMS62F", + "BOARD":"SKiM980A", // MBED Radio shield selection. (Applies only to Nucleo platforms) // The following shields are supported: // SX1272MB2DAS, SX1276MB1LAS, SX1276MB1MAS, SX1261MBXBAS(Default), SX1262MBXCAS, SX1262MBXDAS, LR1110MB1XXS. - "MBED_RADIO_SHIELD":"SX1262MBXCAS", + "MBED_RADIO_SHIELD":"SX1272MB2DAS", // Secure element type selection the following are supported // SOFT_SE(Default), LR1110_SE, ATECC608A_TNGLORA_SE @@ -86,6 +86,7 @@ "utilities.h": "c", "se-identity.h": "c", "githubversion.h": "c", - "commissioning.h": "c" + "commissioning.h": "c", + "stm32l1xx_hal_rcc.h": "c" } } diff --git a/src/apps/LoRaMac/common/Commissioning.h b/src/apps/LoRaMac/common/Commissioning.h index e7a733080..ee16b16a4 100644 --- a/src/apps/LoRaMac/common/Commissioning.h +++ b/src/apps/LoRaMac/common/Commissioning.h @@ -40,7 +40,7 @@ * When set to 1 the application uses the Over-the-Air activation procedure * When set to 0 the application uses the Personalization activation procedure */ -#define OVER_THE_AIR_ACTIVATION 0 +#define OVER_THE_AIR_ACTIVATION 1 /*! * When using ABP activation the MAC layer must know in advance to which server diff --git a/src/boards/SKiM980A/CMakeLists.txt b/src/boards/SKiM980A/CMakeLists.txt index 4cf75982c..f4e13e57e 100644 --- a/src/boards/SKiM980A/CMakeLists.txt +++ b/src/boards/SKiM980A/CMakeLists.txt @@ -54,7 +54,7 @@ list(APPEND ${PROJECT_NAME}_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32/STM32L1xx_HAL_Driver/Src/stm32l1xx_hal_rtc.c" "${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32/STM32L1xx_HAL_Driver/Src/stm32l1xx_hal_rtc_ex.c" "${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32/STM32L1xx_HAL_Driver/Src/stm32l1xx_hal_spi.c" - "${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32/STM32L1xx_HAL_Driver/Src/stm32l1xx_hal_spi_ex.c" + #"${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32/STM32L1xx_HAL_Driver/Src/stm32l1xx_hal_spi_ex.c" "${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32/STM32L1xx_HAL_Driver/Src/stm32l1xx_hal_uart.c" ) diff --git a/src/boards/SKiM980A/board.c b/src/boards/SKiM980A/board.c index c38ebd4a2..0e896b95a 100644 --- a/src/boards/SKiM980A/board.c +++ b/src/boards/SKiM980A/board.c @@ -319,12 +319,12 @@ uint8_t BoardGetBatteryLevel( void ) BatteryVoltage = BoardBatteryMeasureVoltage( ); - if( GetBoardPowerSource( ) == USB_POWER ) - { - batteryLevel = 0; - } - else - { + // if( GetBoardPowerSource( ) == USB_POWER ) + // { + // batteryLevel = 0; + // } + // else + // { if( BatteryVoltage >= BATTERY_MAX_LEVEL ) { batteryLevel = 254; @@ -341,7 +341,7 @@ uint8_t BoardGetBatteryLevel( void ) { batteryLevel = 255; } - } + // } return batteryLevel; } diff --git a/src/boards/SKiM980A/cmsis/stm32l1xx_hal_conf.h b/src/boards/SKiM980A/cmsis/stm32l1xx_hal_conf.h index 82bd000e7..e7fc8d248 100644 --- a/src/boards/SKiM980A/cmsis/stm32l1xx_hal_conf.h +++ b/src/boards/SKiM980A/cmsis/stm32l1xx_hal_conf.h @@ -110,6 +110,15 @@ #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ #endif /* HSI_VALUE */ +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE (37000U) /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ + /** * @brief External Low Speed oscillator (LSE) value. * This value is used by the UART, RTC HAL module to compute the system frequency