Skip to content

Commit

Permalink
Fix type for boufallolab
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 committed Oct 3, 2023
1 parent e764c84 commit d37cca9
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions examples/platform/bouffalolab/common/rpc/Rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ class BouffaloButton final : public Button
class BouffaloDevice final : public Device
{
public:
pw::Status Reboot(const pw_protobuf_Empty & request, pw_protobuf_Empty & response) override
pw::Status Reboot(const chip_rpc_RebootRequest & request, pw_protobuf_Empty & response) override
{
if (mRebootTimer)
{
return pw::OkStatus();
return pw::Status::Unavailable();
}

TickType_t delayMs = kRebootTimerPeriodMs;
Expand All @@ -118,12 +118,15 @@ class BouffaloDevice final : public Device

pw::Status FactoryReset(const pw_protobuf_Empty & request, pw_protobuf_Empty & response) override
{
if (!mRebootTimer)
if (mRebootTimer)
{
mRebootTimer = xTimerCreateStatic("FactoryReset", kRebootTimerPeriodTicks, false, nullptr, FactoryResetHandler,
&mRebootTimerBuffer);
xTimerStart(mRebootTimer, 0);
return pw::Status::Unavailable();
}

// Notice: reboot delay not configurable here
mRebootTimer = xTimerCreateStatic("FactoryReset", pdMS_TO_TICKS(kRebootTimerPeriodMs), false, nullptr, FactoryResetHandler,
&mRebootTimerBuffer);
xTimerStart(mRebootTimer, 0);
return pw::OkStatus();
}

Expand Down

0 comments on commit d37cca9

Please sign in to comment.