From 5c801676109ce1eb2bc04d42f1c8386644121544 Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Sun, 8 Nov 2020 16:55:27 +0100 Subject: [PATCH] changes --- cube/User/Src/main2.c | 8 ++++---- cube/User/Src/wizHelper.c | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/cube/User/Src/main2.c b/cube/User/Src/main2.c index c22bfe1..8fc823f 100644 --- a/cube/User/Src/main2.c +++ b/cube/User/Src/main2.c @@ -190,11 +190,11 @@ void my_setup_2() { wizInit(); -// frontendInit(); -// frontendSetThreshold(240); + frontendInit(); + frontendSetThreshold(240); -// schAdd(scheduleMBusRequest, NULL, 0, 1000); -// schAdd(triggerMBusRequest, NULL, 0, 100); + schAdd(scheduleMBusRequest, NULL, 0, 1000); + schAdd(triggerMBusRequest, NULL, 0, 100); } void my_loop() { diff --git a/cube/User/Src/wizHelper.c b/cube/User/Src/wizHelper.c index 4890b57..80e8758 100644 --- a/cube/User/Src/wizHelper.c +++ b/cube/User/Src/wizHelper.c @@ -47,9 +47,13 @@ static void wizReset(bool b) { } static void wizDHCPHandler(void *handle) { + static uint8_t lastStablePhyLink = 255; uint8_t phyLink = 0; int8_t res = ctlwizchip(CW_GET_PHYLINK, (void*) &phyLink); - coloredMsg(LOG_RED, "wizdh, ctlwizchip returns %d, phy link is %d", res, phyLink); + if (lastStablePhyLink != phyLink) { + coloredMsg(LOG_RED, "wizdh, ctlwizchip returns %d, phy link changed to %d", res, phyLink); + lastStablePhyLink = phyLink; + } } int wizInit() {