Merge branch 'master' of ssh://home.hottis.de:2922/wolutator/mains-frequency-counter-stm32 into master

This commit is contained in:
Wolfgang Hottgenroth 2021-02-22 10:47:36 +01:00
commit f16b38ffd5
Signed by: wn
GPG Key ID: 6C1E5E531E0D5D7F
7 changed files with 49 additions and 4 deletions

View File

@ -102,7 +102,8 @@ endif
ifeq ($(NETWORK), WiFi)
C_SOURCES += \
User/Src/networkAbstractionLayer_wifi.c
User/Src/networkAbstractionLayer_wifi.c \
User/Src/modemCom.c
NETWORK_STACK=2
endif
@ -183,7 +184,7 @@ endif
# compile gcc flags
ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -Werror -fdata-sections -ffunction-sections
CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -DNETWORK=$(NETWORK_STACK) -DVERSION="\"$(VERSION)\"" -Wall -Werror -fdata-sections -ffunction-sections
CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -DNETWORK_STACK=$(NETWORK_STACK) -DVERSION="\"$(VERSION)\"" -Wall -Werror -fdata-sections -ffunction-sections
ifeq ($(DEBUG), 1)
CFLAGS += -g -gdwarf-2

16
cube/User/Inc/modemCom.h Normal file
View File

@ -0,0 +1,16 @@
#ifndef _MODEM_COM_H_
#define _MODEM_COM_H_
#include <usart.h>
#if NETWORK_STACK == 2 // WiFi
void modemTxCpltCallback(UART_HandleTypeDef *huart);
void modemRxCpltCallback(UART_HandleTypeDef *huart);
#endif
#endif // _MODEM_COM_H_

View File

@ -17,4 +17,5 @@ t_seconds* networkGetSeconds();
int8_t networkSendMinuteBuffer(t_minuteBuffer *minuteBuffer);
#endif /* _NETWORK_ABSTRACTION_LAYER_H_ */

View File

@ -7,4 +7,5 @@ uint64_t networkSntpQuery();
int8_t networkUdpSend(char *hostname, uint16_t port, uint8_t *buf, uint16_t bufLen);
void networkImplInit();
#endif /* _NETWORK_ABSTRACTION_LAYER_IMPL_H_ */

View File

@ -17,6 +17,9 @@
#include <config.h>
#include <counter.h>
#if NETWORK_STACK == 2
#include <modemCom.h>
#endif
@ -43,7 +46,7 @@ void my_setup_2() {
networkInit();
counterInit();
// counterInit();
logMsg("Application running");
}
@ -76,6 +79,17 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart) {
#endif
}
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) {
#if NETWORK_STACK == 2
if (huart == &modemUart) {
modemRxCpltCallback(huart);
}
#endif
}
void HAL_SPI_TxCpltCallback(SPI_HandleTypeDef *hspi) {
if (hspi == &eepromSpi) {
eepromSpiTxCpltCallback(hspi);

12
cube/User/Src/modemCom.c Normal file
View File

@ -0,0 +1,12 @@
#include <modemCom.h>
#include <usart.h>
void modemTxCpltCallback(UART_HandleTypeDef *huart) {
}
void modemRxCpltCallback(UART_HandleTypeDef *huart) {
}

View File

@ -3,7 +3,7 @@
#include <utils.h>
#include <stdint.h>
#include <main.h>
uint64_t networkSntpQuery() {