Skip to content

Commit

Permalink
Reset user setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Anol Paisal committed Mar 7, 2022
1 parent 8d90c6c commit 864dd48
Show file tree
Hide file tree
Showing 9 changed files with 1,571 additions and 11 deletions.
7 changes: 4 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"APPLICATION":"LoRaMac",

// Select LoRaMac sub project. You can choose between:
// periodic-uplink-lpp, fuota-test-01.
"SUB_PROJECT":"periodic-uplink-lpp",
// periodic-uplink-lpp, periodic-uplink-lpp-counter, fuota-test-01.
"SUB_PROJECT":"periodic-uplink-lpp-counter",

// Switch for Class B support of LoRaMac:
"CLASSB_ENABLED":"ON",
Expand Down Expand Up @@ -87,6 +87,7 @@
"se-identity.h": "c",
"githubversion.h": "c",
"commissioning.h": "c",
"stm32l1xx_hal_rcc.h": "c"
"stm32l1xx_hal_rcc.h": "c",
"lpm-board.h": "c"
}
}
32 changes: 31 additions & 1 deletion src/apps/LoRaMac/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cmake_minimum_required(VERSION 3.6)
#---------------------------------------------------------------------------------------

# Allow switching of sub projects
set(SUB_PROJECT_LIST periodic-uplink-lpp fuota-test-01)
set(SUB_PROJECT_LIST periodic-uplink-lpp periodic-uplink-lpp-counter fuota-test-01)
set(SUB_PROJECT periodic-uplink-lpp CACHE STRING "Default sub project is periodic-uplink-lpp")
set_property(CACHE SUB_PROJECT PROPERTY STRINGS ${SUB_PROJECT_LIST})

Expand Down Expand Up @@ -72,6 +72,36 @@ if(SUB_PROJECT STREQUAL periodic-uplink-lpp)
"${CMAKE_CURRENT_LIST_DIR}/common/LmHandler/packages/LmhpRemoteMcastSetup.c"
)

elseif(SUB_PROJECT STREQUAL periodic-uplink-lpp-counter)

#---------------------------------------------------------------------------------------
# Application common features handling
#---------------------------------------------------------------------------------------
list(APPEND ${PROJECT_NAME}_COMMON
"${CMAKE_CURRENT_LIST_DIR}/common/CayenneLpp.c"
"${CMAKE_CURRENT_LIST_DIR}/common/cli.c"
"${CMAKE_CURRENT_LIST_DIR}/common/LmHandlerMsgDisplay.c"
"${CMAKE_CURRENT_LIST_DIR}/common/NvmDataMgmt.c"
)

#---------------------------------------------------------------------------------------
# Application LoRaMac handler
#---------------------------------------------------------------------------------------
list(APPEND ${PROJECT_NAME}_LMH
"${CMAKE_CURRENT_LIST_DIR}/common/LmHandler/LmHandler.c"
)

#---------------------------------------------------------------------------------------
# LoRaMac handler applicative packages
#---------------------------------------------------------------------------------------
list(APPEND ${PROJECT_NAME}_LMHP
"${CMAKE_CURRENT_LIST_DIR}/common/LmHandler/packages/FragDecoder.c"
"${CMAKE_CURRENT_LIST_DIR}/common/LmHandler/packages/LmhpClockSync.c"
"${CMAKE_CURRENT_LIST_DIR}/common/LmHandler/packages/LmhpCompliance.c"
"${CMAKE_CURRENT_LIST_DIR}/common/LmHandler/packages/LmhpFragmentation.c"
"${CMAKE_CURRENT_LIST_DIR}/common/LmHandler/packages/LmhpRemoteMcastSetup.c"
)

elseif(SUB_PROJECT STREQUAL fuota-test-01)

#---------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/apps/LoRaMac/common/Commissioning.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 1
#define OVER_THE_AIR_ACTIVATION 0

/*!
* When using ABP activation the MAC layer must know in advance to which server
Expand Down
6 changes: 6 additions & 0 deletions src/apps/LoRaMac/common/NvmDataMgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,12 @@ bool NvmDataMgmtFactoryReset( void )
return false;
}
offset += sizeof( LoRaMacClassBNvmData_t );

if( NvmmReset( 8U, 0x0FF8) == false )
{
return false;
}

#endif
return true;
}
Loading

0 comments on commit 864dd48

Please sign in to comment.