rename signal to show

This commit is contained in:
2020-11-03 10:05:45 +01:00
parent 92d31980c8
commit 83c6d65172
8 changed files with 21 additions and 21 deletions

View File

@ -37,7 +37,7 @@ BUILD_DIR = build
######################################
# C sources
C_SOURCES = \
User/Src/frontend.c User/Src/signal.c User/Src/logger.c User/Src/loopCtrl.c User/Src/main2.c User/Src/mbusComm.c User/Src/ringbuffer.c hottislib/PontCoopScheduler.c \
User/Src/frontend.c User/Src/show.c User/Src/logger.c User/Src/loopCtrl.c User/Src/main2.c User/Src/mbusComm.c User/Src/ringbuffer.c hottislib/PontCoopScheduler.c \
libmbus/mbus/mbus-protocol.c \
Core/Src/main.c \
Core/Src/gpio.c \

View File

@ -1,5 +1,5 @@
#ifndef _DEBUG_H_
#define _DEBUG_H_
#ifndef _SHOW_H_
#define _SHOW_H_
#include <stdint.h>
@ -7,7 +7,7 @@
typedef enum { DEBUG_1, DEBUG_2, LED_RED, LED_GREEN } signalPin_t;
typedef enum { ON, OFF, TOGGLE } signalAction_t;
void signal(signalPin_t signalPin, signalAction_t action);
void show(signalPin_t signalPin, signalAction_t action);
#endif // _DEBUG_H_
#endif // _SHOW_H_

View File

@ -5,7 +5,7 @@
#include <frontend.h>
#include <logger.h>
#include <signal.h>
#include <show.h>
@ -37,7 +37,7 @@ void frontendDisable() {
void frontendAdcCallback(ADC_HandleTypeDef* hadc) {
static int32_t holdValue = 0;
signal(DEBUG_2, TOGGLE);
show(DEBUG_2, TOGGLE);
if (frontendEnabled) {
int32_t currentValue = (int32_t) HAL_ADC_GetValue(hadc);

View File

@ -1,7 +1,7 @@
#ifndef TEST
#include <main.h>
#include <usart.h>
#include <signal.h>
#include <show.h>
#include <PontCoopScheduler.h>
#endif
@ -56,7 +56,7 @@ int logExec() {
#ifndef TEST
static void flashGreenLed(void *handle) {
signal(LED_GREEN, TOGGLE);
show(LED_GREEN, TOGGLE);
}
#endif // TEST

View File

@ -1,6 +1,6 @@
#include <main.h>
#include <loopCtrl.h>
#include <signal.h>
#include <show.h>
bool loopActive = false;
@ -20,7 +20,7 @@ void loopDisable() {
void loopStatusCallback() {
GPIO_PinState status = HAL_GPIO_ReadPin(Loop_Status_GPIO_Port, Loop_Status_Pin);
if (status == GPIO_PIN_SET) {
signal(LED_RED, ON);
show(LED_RED, ON);
loopActive = false;
}
}

View File

@ -9,7 +9,7 @@
#include <PontCoopScheduler.h>
#include <signal.h>
#include <show.h>
#include <loopCtrl.h>
#include <mbusComm.h>
#include <logger.h>
@ -21,7 +21,7 @@ void my_setup_1() {
}
void my_errorHandler() {
signal(LED_RED, ON);
show(LED_RED, ON);
}
void helloMeterbus(void *handle) {
@ -36,8 +36,8 @@ void helloMeterbus(void *handle) {
void my_setup_2() {
signal(LED_RED, OFF);
signal(LED_GREEN, ON);
show(LED_RED, OFF);
show(LED_GREEN, ON);
frontendInit();
frontendSetThreshold(240);
@ -46,7 +46,7 @@ void my_setup_2() {
}
void my_loop() {
signal(DEBUG_1, TOGGLE);
show(DEBUG_1, TOGGLE);
schExec();
logExec();

View File

@ -8,7 +8,7 @@
#include <PontCoopScheduler.h>
#include <mbusComm.h>
#include <loopCtrl.h>
#include <signal.h>
#include <show.h>
#include <logger.h>
#include <frontend.h>
@ -99,7 +99,7 @@ static void handleRequestEngine(void *handle) {
case MBCS_SEND_CONT:
logMsg("hre state SEND_CONT");
signal(LED_RED, OFF);
show(LED_RED, OFF);
if (! loopActive) {
logMsg("hre enabling loop, try %d", localMbusCommHandle->retryCnt);
localMbusCommHandle->retryCnt++;
@ -266,7 +266,7 @@ static void handleRequestEngine(void *handle) {
case MBCS_ERROR:
logMsg("hre state ERROR");
signal(LED_RED, ON);
show(LED_RED, ON);
logMsg("hre err: already error, read the rest (now: %02x) until timeout", localMbusCommHandle->receivedOctet);
receiveNext(localMbusCommHandle);
break;

View File

@ -1,11 +1,11 @@
#include <main.h>
#include <signal.h>
#include <show.h>
#include <stdint.h>
#include <stdlib.h>
#include <stm32f103xe.h>
void signal(signalPin_t signalPin, signalAction_t action) {
void show(signalPin_t signalPin, signalAction_t action) {
GPIO_TypeDef *port = NULL;
uint16_t pin = 0;