Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Telink] Fix simulatedIndex max number & disable NET_MGMT #26293

Merged
merged 12 commits into from
May 5, 2023
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