Compare commits
3 Commits
new_sntp_s
...
FirstRelea
Author | SHA1 | Date | |
---|---|---|---|
7c1e230965 | |||
6611220851 | |||
fe1bc101a3 |
2
.gitignore
vendored
2
.gitignore
vendored
@ -6,5 +6,5 @@ cube/pubsubc.a
|
||||
test
|
||||
.bash_history
|
||||
.vscode
|
||||
|
||||
tools/ENV
|
||||
|
||||
|
@ -12,7 +12,7 @@ typedef enum {
|
||||
LED_BLUE
|
||||
} signalPin_t;
|
||||
|
||||
typedef enum { ON, OFF, TOGGLE, BLINK } signalAction_t;
|
||||
typedef enum { ON, OFF, TOGGLE, BLINK, BLINK_FAST } signalAction_t;
|
||||
|
||||
void showInit();
|
||||
void show(signalPin_t signalPin, signalAction_t action);
|
||||
|
@ -48,7 +48,7 @@ void counterMinuteTick(void *handle) {
|
||||
minuteBuffer->s.totalRunningHours = deviceStats->totalRunningHours;
|
||||
minuteBuffer->s.totalPowercycles = deviceStats->totalPowercycles;
|
||||
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));
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include <iwdg.h>
|
||||
#include <logger.h>
|
||||
#include <sinkStruct.h>
|
||||
#include <show.h>
|
||||
#include <config.h>
|
||||
|
||||
#include <networkAbstractionLayer_impl.h>
|
||||
@ -28,6 +29,7 @@ static void networkSecondsHandler(void *handle) {
|
||||
seconds.seconds = tmpSeconds;
|
||||
seconds.missedUpdates = 0;
|
||||
seconds.valid = true;
|
||||
show(LED_GREEN, ON);
|
||||
} else {
|
||||
coloredMsg(LOG_YELLOW, "nsh, failed");
|
||||
seconds.missedUpdates += 1;
|
||||
@ -39,6 +41,7 @@ static void networkSecondsHandler(void *handle) {
|
||||
coloredMsg(LOG_YELLOW, "nsh, success, network time is %lu", tmpSeconds);
|
||||
seconds.missedUpdates = 0;
|
||||
tryAgain = false;
|
||||
show(LED_GREEN, ON);
|
||||
if (seconds.seconds != tmpSeconds) {
|
||||
coloredMsg(LOG_YELLOW, "nsh, local time updated");
|
||||
seconds.seconds = tmpSeconds;
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include <main.h>
|
||||
#include <show.h>
|
||||
#include <PontCoopScheduler.h>
|
||||
#include <show.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
@ -24,9 +25,20 @@ showElement_t showElement[] = {
|
||||
};
|
||||
|
||||
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;
|
||||
while (showElement[idx].port) {
|
||||
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);
|
||||
}
|
||||
idx++;
|
||||
@ -43,5 +55,5 @@ void show(signalPin_t signalPin, signalAction_t action) {
|
||||
}
|
||||
|
||||
void showInit() {
|
||||
schAdd(showHandler, NULL, 0, 250);
|
||||
schAdd(showHandler, NULL, 0, 100);
|
||||
}
|
@ -86,7 +86,7 @@ static void wizDHCPAssign() {
|
||||
coloredMsg(LOG_BLUE, "wizda, set netinfo again");
|
||||
|
||||
networkAvailable = true;
|
||||
show(LED_GREEN, ON);
|
||||
show(LED_GREEN, BLINK_FAST);
|
||||
coloredMsg(LOG_BLUE, "wizda, network is available");
|
||||
}
|
||||
|
||||
|
2
tools/ENV.tmpl
Normal file
2
tools/ENV.tmpl
Normal file
@ -0,0 +1,2 @@
|
||||
export PRIVATETOKEN=privateToken
|
||||
|
27
tools/release.sh
Executable file
27
tools/release.sh
Executable 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
|
||||
|
Reference in New Issue
Block a user