Skip to content

Commit

Permalink
[Telink] Fix simulatedIndex max number & disable NET_MGMT (#26293)
Browse files Browse the repository at this point in the history
* [Telink] Fix SensorManager simulatedIndex max number

* Restyled by clang-format

* [Telink] Fix copy paste typo

* [Telink] Remove NET_CONFIG_SETTINGS which select NET_MGMT

* [Telink] Enable extended discovery

* Revert "[Telink] Enable extended discovery"

This reverts commit 4555e99.

* [Telink] Use ArraySize macro

* [Telink] Temporary button IRQ issue hotfix

---------

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Oct 11, 2023
1 parent 8ad4d0b commit f83468f
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 14 deletions.
4 changes: 0 additions & 4 deletions config/telink/app/zephyr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ CONFIG_LOG_MAX_LEVEL=3

# Generic networking options
CONFIG_NETWORKING=y
CONFIG_NET_CONFIG_SETTINGS=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_POSIX_NAMES=n
CONFIG_NET_CONFIG_INIT_TIMEOUT=0
Expand Down Expand Up @@ -94,9 +93,6 @@ CONFIG_NET_L2_OPENTHREAD=y
CONFIG_OPENTHREAD_DEBUG=y
CONFIG_OPENTHREAD_L2_DEBUG=y

CONFIG_NET_CONFIG_MY_IPV6_ADDR="fdde:ad00:beef::1"
CONFIG_NET_CONFIG_PEER_IPV6_ADDR="fdde:ad00:beef::2"

# OpenThread configs
CONFIG_OPENTHREAD_SLAAC=y
CONFIG_OPENTHREAD_RADIO_WORKQUEUE_STACK_SIZE=608
Expand Down
12 changes: 6 additions & 6 deletions examples/platform/telink/common/src/AppTaskCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,27 +247,27 @@ void AppTaskCommon::InitButtons(void)
#if CONFIG_CHIP_BUTTON_MANAGER_IRQ_MODE
sFactoryResetButton.Configure(BUTTON_PORT, BUTTON_PIN_1, FactoryResetButtonEventHandler);
sBleAdvStartButton.Configure(BUTTON_PORT, BUTTON_PIN_4, StartBleAdvButtonEventHandler);
#if APP_USE_THREAD_START_BUTTON
sThreadStartButton.Configure(BUTTON_PORT, BUTTON_PIN_3, StartThreadButtonEventHandler);
#endif
#if APP_USE_EXAMPLE_START_BUTTON
if (ExampleActionEventHandler)
{
sExampleActionButton.Configure(BUTTON_PORT, BUTTON_PIN_2, ExampleActionButtonEventHandler);
}
#endif
#if APP_USE_THREAD_START_BUTTON
sThreadStartButton.Configure(BUTTON_PORT, BUTTON_PIN_3, StartThreadButtonEventHandler);
#endif
#else
sFactoryResetButton.Configure(BUTTON_PORT, BUTTON_PIN_3, BUTTON_PIN_1, FactoryResetButtonEventHandler);
sBleAdvStartButton.Configure(BUTTON_PORT, BUTTON_PIN_4, BUTTON_PIN_2, StartBleAdvButtonEventHandler);
#if APP_USE_THREAD_START_BUTTON
sThreadStartButton.Configure(BUTTON_PORT, BUTTON_PIN_3, BUTTON_PIN_2, StartThreadButtonEventHandler);
#endif
#if APP_USE_EXAMPLE_START_BUTTON
if (ExampleActionEventHandler)
{
sExampleActionButton.Configure(BUTTON_PORT, BUTTON_PIN_4, BUTTON_PIN_1, ExampleActionButtonEventHandler);
}
#endif
#if APP_USE_THREAD_START_BUTTON
sThreadStartButton.Configure(BUTTON_PORT, BUTTON_PIN_3, BUTTON_PIN_2, StartThreadButtonEventHandler);
#endif
#endif

ButtonManagerInst().AddButton(sFactoryResetButton);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ int16_t SensorManager::SensorEventHandler()
#ifdef TEMPERATURE_SIMULATION_IS_USED
static uint8_t nbOfRepetition = 0;
static uint8_t simulatedIndex = 0;
if (simulatedIndex >= sizeof(mSimulatedTemp) - 1)
if (simulatedIndex >= ArraySize(mSimulatedTemp))
{
simulatedIndex = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/thermostat/silabs/efr32/src/SensorManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void SensorManager::SensorTimerEventHandler(TimerHandle_t xTimer)
#else
static uint8_t nbOfRepetition = 0;
static uint8_t simulatedIndex = 0;
if (simulatedIndex >= sizeof(mSimulatedTemp))
if (simulatedIndex >= ArraySize(mSimulatedTemp))
{
simulatedIndex = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/thermostat/telink/src/SensorManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void SensorManager::SensorTimerEventHandler(AppEvent * aEvent)

static uint8_t nbOfRepetition = 0;
static uint8_t simulatedIndex = 0;
if (simulatedIndex >= sizeof(mSimulatedTemp))
if (simulatedIndex >= ArraySize(mSimulatedTemp))
{
simulatedIndex = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/platform/telink/ConnectivityManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ inline ConnectivityManager & ConnectivityMgr(void)
* Returns the platform-specific implementation of the ConnectivityManager singleton object.
*
* chip applications can use this to gain access to features of the ConnectivityManager
* that are specific to the ESP32 platform.
* that are specific to the Telink platform.
*/
inline ConnectivityManagerImpl & ConnectivityMgrImpl(void)
{
Expand Down

0 comments on commit f83468f

Please sign in to comment.