3 Commits

Author SHA1 Message Date
7c1e230965 release script added 2021-03-30 11:03:45 +02:00
6611220851 better blink 2021-03-03 19:16:22 +01:00
fe1bc101a3 version 2021-03-03 19:06:12 +01:00
8 changed files with 49 additions and 5 deletions

2
.gitignore vendored
View File

@ -6,5 +6,5 @@ cube/pubsubc.a
test test
.bash_history .bash_history
.vscode .vscode
tools/ENV

View File

@ -12,7 +12,7 @@ typedef enum {
LED_BLUE LED_BLUE
} signalPin_t; } signalPin_t;
typedef enum { ON, OFF, TOGGLE, BLINK } signalAction_t; typedef enum { ON, OFF, TOGGLE, BLINK, BLINK_FAST } signalAction_t;
void showInit(); void showInit();
void show(signalPin_t signalPin, signalAction_t action); void show(signalPin_t signalPin, signalAction_t action);

View File

@ -48,7 +48,7 @@ void counterMinuteTick(void *handle) {
minuteBuffer->s.totalRunningHours = deviceStats->totalRunningHours; minuteBuffer->s.totalRunningHours = deviceStats->totalRunningHours;
minuteBuffer->s.totalPowercycles = deviceStats->totalPowercycles; minuteBuffer->s.totalPowercycles = deviceStats->totalPowercycles;
minuteBuffer->s.totalWatchdogResets = deviceStats->totalWatchdogResets; minuteBuffer->s.totalWatchdogResets = deviceStats->totalWatchdogResets;
minuteBuffer->s.version = strtol(VERSION, NULL, 16); minuteBuffer->s.version = strtoll(VERSION, NULL, 16);
memset(minuteBuffer->s.deviceId, 0, sizeof(minuteBuffer->s.deviceId)); memset(minuteBuffer->s.deviceId, 0, sizeof(minuteBuffer->s.deviceId));

View File

@ -3,6 +3,7 @@
#include <iwdg.h> #include <iwdg.h>
#include <logger.h> #include <logger.h>
#include <sinkStruct.h> #include <sinkStruct.h>
#include <show.h>
#include <config.h> #include <config.h>
#include <networkAbstractionLayer_impl.h> #include <networkAbstractionLayer_impl.h>
@ -28,6 +29,7 @@ static void networkSecondsHandler(void *handle) {
seconds.seconds = tmpSeconds; seconds.seconds = tmpSeconds;
seconds.missedUpdates = 0; seconds.missedUpdates = 0;
seconds.valid = true; seconds.valid = true;
show(LED_GREEN, ON);
} else { } else {
coloredMsg(LOG_YELLOW, "nsh, failed"); coloredMsg(LOG_YELLOW, "nsh, failed");
seconds.missedUpdates += 1; seconds.missedUpdates += 1;
@ -39,6 +41,7 @@ static void networkSecondsHandler(void *handle) {
coloredMsg(LOG_YELLOW, "nsh, success, network time is %lu", tmpSeconds); coloredMsg(LOG_YELLOW, "nsh, success, network time is %lu", tmpSeconds);
seconds.missedUpdates = 0; seconds.missedUpdates = 0;
tryAgain = false; tryAgain = false;
show(LED_GREEN, ON);
if (seconds.seconds != tmpSeconds) { if (seconds.seconds != tmpSeconds) {
coloredMsg(LOG_YELLOW, "nsh, local time updated"); coloredMsg(LOG_YELLOW, "nsh, local time updated");
seconds.seconds = tmpSeconds; seconds.seconds = tmpSeconds;

View File

@ -1,6 +1,7 @@
#include <main.h> #include <main.h>
#include <show.h> #include <show.h>
#include <PontCoopScheduler.h> #include <PontCoopScheduler.h>
#include <show.h>
#include <stdint.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
@ -24,9 +25,20 @@ showElement_t showElement[] = {
}; };
static void showHandler(void *handle) { static void showHandler(void *handle) {
const uint8_t MAX_CNT = 3;
static uint8_t cnt = 0;
cnt += 1;
if (cnt > MAX_CNT) {
cnt = 0;
}
uint8_t idx = 0; uint8_t idx = 0;
while (showElement[idx].port) { while (showElement[idx].port) {
if (showElement[idx].currentState == BLINK) { if (showElement[idx].currentState == BLINK) {
if (cnt == MAX_CNT) {
HAL_GPIO_TogglePin(showElement[idx].port, showElement[idx].pin);
}
} else if (showElement[idx].currentState == BLINK_FAST) {
HAL_GPIO_TogglePin(showElement[idx].port, showElement[idx].pin); HAL_GPIO_TogglePin(showElement[idx].port, showElement[idx].pin);
} }
idx++; idx++;
@ -43,5 +55,5 @@ void show(signalPin_t signalPin, signalAction_t action) {
} }
void showInit() { void showInit() {
schAdd(showHandler, NULL, 0, 250); schAdd(showHandler, NULL, 0, 100);
} }

View File

@ -86,7 +86,7 @@ static void wizDHCPAssign() {
coloredMsg(LOG_BLUE, "wizda, set netinfo again"); coloredMsg(LOG_BLUE, "wizda, set netinfo again");
networkAvailable = true; networkAvailable = true;
show(LED_GREEN, ON); show(LED_GREEN, BLINK_FAST);
coloredMsg(LOG_BLUE, "wizda, network is available"); coloredMsg(LOG_BLUE, "wizda, network is available");
} }

2
tools/ENV.tmpl Normal file
View File

@ -0,0 +1,2 @@
export PRIVATETOKEN=privateToken

27
tools/release.sh Executable file
View File

@ -0,0 +1,27 @@
#!/bin/bash
RELEASENAME=$1
RELEASETAG=$2
DESCRIPTION=$3
if [ "$RELEASENAME" = "" -o "$RELEASETAG" = "" -o "$DESCRIPTION" = "" ]; then
echo "release.sh RELEASENAME RELEASETAG DESCRIPTION"
exit 1
fi
RELEASETAGTARGET=`git rev-parse --short=8 HEAD`
gitlabreleaseuploader.py \
--privateToken $PRIVATETOKEN \
--projectId 128 \
--projectUrl https://home.hottis.de/gitlab/wolutator/mains-frequency-counter-stm32 \
--releaseName "$RELEASENAME" \
--createRelease \
--releaseTag $RELEASETAG \
--releaseTagTarget $RELEASETAGTARGET \
--createReleaseTag \
--description "$DESCRIPTION" \
--instanceUrl https://home.hottis.de/gitlab \
--verbose \
--file cube/build/cube.elf