Skip to content

Commit

Permalink
Moved IO dependency from Qorvo's glue code to Qorvo's SW stack library (
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdm-qorvo authored and pull[bot] committed May 14, 2022
1 parent 1cc8168 commit b4b937b
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 27 deletions.
14 changes: 7 additions & 7 deletions examples/lighting-app/qpg/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* limitations under the License.
*/

#include "qvCHIP.h"
#include "qvIO.h"

#include "AppConfig.h"
#include "AppEvent.h"
Expand Down Expand Up @@ -107,7 +107,7 @@ CHIP_ERROR AppTask::Init()
LightingMgr().SetCallbacks(ActionInitiated, ActionCompleted);

// Subscribe with our button callback to the qvCHIP button handler.
qvCHIP_SetBtnCallback(ButtonEventHandler);
qvIO_SetBtnCallback(ButtonEventHandler);

// Init ZCL Data Model
chip::Server::GetInstance().Init();
Expand Down Expand Up @@ -178,15 +178,15 @@ void AppTask::AppTaskMain(void * pvParameter)
{
if (sIsThreadProvisioned && sIsThreadEnabled)
{
qvCHIP_LedBlink(SYSTEM_STATE_LED, 950, 50);
qvIO_LedBlink(SYSTEM_STATE_LED, 950, 50);
}
else if (sHaveBLEConnections)
{
qvCHIP_LedBlink(SYSTEM_STATE_LED, 100, 100);
qvIO_LedBlink(SYSTEM_STATE_LED, 100, 100);
}
else
{
qvCHIP_LedBlink(SYSTEM_STATE_LED, 50, 950);
qvIO_LedBlink(SYSTEM_STATE_LED, 50, 950);
}
}
}
Expand Down Expand Up @@ -301,9 +301,9 @@ void AppTask::FunctionTimerEventHandler(AppEvent * aEvent)

// Turn off all LEDs before starting blink to make sure blink is
// co-ordinated.
qvCHIP_LedSet(SYSTEM_STATE_LED, false);
qvIO_LedSet(SYSTEM_STATE_LED, false);

qvCHIP_LedBlink(SYSTEM_STATE_LED, 500, 500);
qvIO_LedBlink(SYSTEM_STATE_LED, 500, 500);
}
else if (sAppTask.mFunctionTimerActive && sAppTask.mFunction == kFunction_FactoryReset)
{
Expand Down
6 changes: 3 additions & 3 deletions examples/lighting-app/qpg/src/LightingManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

#include "LightingManager.h"
#include "qvCHIP.h"
#include "qvIO.h"
#include <lib/support/logging/CHIPLogging.h>

// initialization values for Blue in XY color space
Expand Down Expand Up @@ -211,6 +211,6 @@ void LightingManager::Set(bool aOn)
void LightingManager::UpdateLight()
{
ChipLogProgress(NotSpecified, "UpdateLight: %d L:%d R:%d G:%d B:%d", mState, mLevel, mRGB.r, mRGB.g, mRGB.b);
qvCHIP_PWMSetColor(mRGB.r, mRGB.g, mRGB.b);
qvCHIP_PWMColorOnOff(mState == kState_On);
qvIO_PWMSetColor(mRGB.r, mRGB.g, mRGB.b);
qvIO_PWMColorOnOff(mState == kState_On);
}
2 changes: 1 addition & 1 deletion examples/lock-app/qpg/include/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#define APP_FUNCTION_BUTTON BTN_SW5

#define SYSTEM_STATE_LED LED_GREEN
#define LOCK_STATE_LED LED_RED
#define LOCK_STATE_LED LED_WHITE

// Time it takes in ms for the simulated actuator to move from one
// state to another.
Expand Down
28 changes: 14 additions & 14 deletions examples/lock-app/qpg/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* limitations under the License.
*/

#include "qvCHIP.h"
#include "qvIO.h"

#include "AppConfig.h"
#include "AppEvent.h"
Expand Down Expand Up @@ -106,9 +106,9 @@ CHIP_ERROR AppTask::Init()
BoltLockMgr().SetCallbacks(ActionInitiated, ActionCompleted);

// Subscribe with our button callback to the qvCHIP button handler.
qvCHIP_SetBtnCallback(ButtonEventHandler);
qvIO_SetBtnCallback(ButtonEventHandler);

qvCHIP_LedSet(LOCK_STATE_LED, !BoltLockMgr().IsUnlocked());
qvIO_LedSet(LOCK_STATE_LED, !BoltLockMgr().IsUnlocked());

// Init ZCL Data Model
chip::Server::GetInstance().Init();
Expand Down Expand Up @@ -175,15 +175,15 @@ void AppTask::AppTaskMain(void * pvParameter)
{
if (sIsThreadProvisioned && sIsThreadEnabled)
{
qvCHIP_LedBlink(SYSTEM_STATE_LED, 950, 50);
qvIO_LedBlink(SYSTEM_STATE_LED, 950, 50);
}
else if (sHaveBLEConnections)
{
qvCHIP_LedBlink(SYSTEM_STATE_LED, 100, 100);
qvIO_LedBlink(SYSTEM_STATE_LED, 100, 100);
}
else
{
qvCHIP_LedBlink(SYSTEM_STATE_LED, 50, 950);
qvIO_LedBlink(SYSTEM_STATE_LED, 50, 950);
}
}
}
Expand Down Expand Up @@ -293,11 +293,11 @@ void AppTask::FunctionTimerEventHandler(AppEvent * aEvent)

// Turn off all LEDs before starting blink to make sure blink is
// co-ordinated.
qvCHIP_LedSet(SYSTEM_STATE_LED, false);
qvCHIP_LedSet(LOCK_STATE_LED, false);
qvIO_LedSet(SYSTEM_STATE_LED, false);
qvIO_LedSet(LOCK_STATE_LED, false);

qvCHIP_LedBlink(SYSTEM_STATE_LED, 500, 500);
qvCHIP_LedBlink(LOCK_STATE_LED, 500, 500);
qvIO_LedBlink(SYSTEM_STATE_LED, 500, 500);
qvIO_LedBlink(LOCK_STATE_LED, 500, 500);
}
else if (sAppTask.mFunctionTimerActive && sAppTask.mFunction == kFunction_FactoryReset)
{
Expand Down Expand Up @@ -375,7 +375,7 @@ void AppTask::FunctionHandler(AppEvent * aEvent)
else if (sAppTask.mFunctionTimerActive && sAppTask.mFunction == kFunction_FactoryReset)
{
// Set lock status LED back to show state of lock.
qvCHIP_LedSet(LOCK_STATE_LED, !BoltLockMgr().IsUnlocked());
qvIO_LedSet(LOCK_STATE_LED, !BoltLockMgr().IsUnlocked());

sAppTask.CancelTimer();

Expand Down Expand Up @@ -428,7 +428,7 @@ void AppTask::ActionInitiated(BoltLockManager::Action_t aAction, int32_t aActor)
sAppTask.mSyncClusterToButtonAction = true;
}

qvCHIP_LedBlink(LOCK_STATE_LED, 50, 50);
qvIO_LedBlink(LOCK_STATE_LED, 50, 50);
}

void AppTask::ActionCompleted(BoltLockManager::Action_t aAction)
Expand All @@ -440,13 +440,13 @@ void AppTask::ActionCompleted(BoltLockManager::Action_t aAction)
{
ChipLogProgress(NotSpecified, "Lock Action has been completed");

qvCHIP_LedSet(LOCK_STATE_LED, true);
qvIO_LedSet(LOCK_STATE_LED, true);
}
else if (aAction == BoltLockManager::UNLOCK_ACTION)
{
ChipLogProgress(NotSpecified, "Unlock Action has been completed");

qvCHIP_LedSet(LOCK_STATE_LED, false);
qvIO_LedSet(LOCK_STATE_LED, false);
}

if (sAppTask.mSyncClusterToButtonAction)
Expand Down
2 changes: 1 addition & 1 deletion third_party/qpg_sdk/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ group("qpg_sdk") {

config("qpg_freertos_config") {
include_dirs = [
"${chip_root}/third_party/qpg_sdk/repo/qpg6100/comps/gpFreeRTOS/config",
"${qpg_sdk_root}/${qpg_target_ic}/comps/gpFreeRTOS/config",
"${chip_root}/third_party/qpg_sdk/repo/qpg6100/comps/lwip",
"${freertos_root}/repo/portable/GCC/ARM_CM3",
]
Expand Down
1 change: 1 addition & 0 deletions third_party/qpg_sdk/qpg_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ template("qpg_sdk") {

include_dirs += [
"${qpg_sdk_root}/${qpg_target_ic}/comps/qvCHIP/inc",
"${qpg_sdk_root}/${qpg_target_ic}/comps/qvIO/inc",
"${qpg_sdk_root}/${qpg_target_ic}/comps/gpFreeRTOS/config",
"${qpg_sdk_root}/${qpg_target_ic}/comps/libmbedtls",
"${mbedtls_root}/repo/include",
Expand Down
2 changes: 1 addition & 1 deletion third_party/qpg_sdk/repo
Submodule repo updated from 184c57 to 49640d

0 comments on commit b4b937b

Please sign in to comment.