Skip to content

Commit

Permalink
[Ameba] Add platform changes (project-chip#32682)
Browse files Browse the repository at this point in the history
* [Ameba] Add platform changes

* [Ameba] add platform changes when getting system time

* [Ameba] add wifi wrapper to fix build issue

* [Ameba] add wifi wrapper to fix build issue

* [Ameba] Update ci to version 42

* [Ameba] add plaform connectivity changes

* [Ameba] add plaform connectivity changes
  • Loading branch information
pankore authored Apr 3, 2024
1 parent 5751750 commit dfb8bb9
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/examples-ameba.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build-ameba:41
image: ghcr.io/project-chip/chip-build-ameba:42
options: --user root

steps:
Expand Down
4 changes: 2 additions & 2 deletions examples/all-clusters-app/ameba/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ The CHIP demo application is supported on

- Pull docker image:

$ docker pull ghcr.io/project-chip/chip-build-ameba:35
$ docker pull ghcr.io/project-chip/chip-build-ameba:42

- Run docker container:

$ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:35
$ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:42

- Setup build environment:

Expand Down
4 changes: 2 additions & 2 deletions examples/light-switch-app/ameba/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ The CHIP demo application is supported on

- Pull docker image:

$ docker pull ghcr.io/project-chip/chip-build-ameba:35
$ docker pull ghcr.io/project-chip/chip-build-ameba:42

- Run docker container:

$ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:35
$ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:42

- Setup build environment:

Expand Down
4 changes: 2 additions & 2 deletions examples/lighting-app/ameba/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ The CHIP demo application is supported on

- Pull docker image:

$ docker pull ghcr.io/project-chip/chip-build-ameba:35
$ docker pull ghcr.io/project-chip/chip-build-ameba:42

- Run docker container:

$ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:35
$ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:42

- Setup build environment:

Expand Down
4 changes: 2 additions & 2 deletions examples/ota-requestor-app/ameba/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ A prototype application that demonstrates OTA Requestor capabilities.

- Pull docker image:

$ docker pull ghcr.io/project-chip/chip-build-ameba:35
$ docker pull ghcr.io/project-chip/chip-build-ameba:42

- Run docker container:

$ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:35
$ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:42

- Setup build environment:

Expand Down
4 changes: 2 additions & 2 deletions examples/pigweed-app/ameba/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ following features are available:

- Pull docker image:

$ docker pull ghcr.io/project-chip/chip-build-ameba:35
$ docker pull ghcr.io/project-chip/chip-build-ameba:42

- Run docker container:

$ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:35
$ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:42

- Setup build environment:

Expand Down
4 changes: 4 additions & 0 deletions src/platform/Ameba/ConnectivityManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,10 @@ void ConnectivityManagerImpl::DriveStationState()
mLastStationConnectFailTime = System::Clock::kZero;
OnStationConnected();
}
else
{
ChangeWiFiStationState(kWiFiStationState_Connecting);
}
}

// Otherwise the station interface is NOT connected to an AP, so...
Expand Down
4 changes: 2 additions & 2 deletions src/platform/Ameba/NetworkCommissioningWiFiDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ CHIP_ERROR AmebaWiFiDriver::ConnectWiFiNetwork(const char * ssid, uint8_t ssidLe
{
CHIP_ERROR err = CHIP_NO_ERROR;
bool connected;

#if CHIP_DEVICE_CONFIG_ENABLE_WIFI
// If device is already connected to WiFi, then disconnect the WiFi,
chip::DeviceLayer::Internal::AmebaUtils::IsStationConnected(connected);
if (connected)
Expand Down Expand Up @@ -159,7 +159,7 @@ CHIP_ERROR AmebaWiFiDriver::ConnectWiFiNetwork(const char * ssid, uint8_t ssidLe
ConnectivityMgrImpl().ChangeWiFiStationState(state);
chip::DeviceLayer::Internal::AmebaUtils::WiFiConnect(ssid, key);
});

#endif
return err;
}

Expand Down
4 changes: 2 additions & 2 deletions src/platform/Ameba/SystemTimeSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ ClockImpl gClockImpl;

Microseconds64 ClockImpl::GetMonotonicMicroseconds64(void)
{
return (Clock::Microseconds64(xTaskGetTickCount()) * configTICK_RATE_HZ);
return Clock::Microseconds64(ameba_get_clock_time());
}

Milliseconds64 ClockImpl::GetMonotonicMilliseconds64(void)
{
return (Clock::Milliseconds64(xTaskGetTickCount()));
return std::chrono::duration_cast<Milliseconds64>(GetMonotonicMicroseconds64());
}

CHIP_ERROR ClockImpl::GetClock_RealTime(Clock::Microseconds64 & curTime)
Expand Down

0 comments on commit dfb8bb9

Please sign in to comment.