modem stuff
This commit is contained in:
parent
1f124976e7
commit
84f58a343e
@ -61,6 +61,7 @@ void Error_Handler(void);
|
||||
#define eepromSpi hspi1
|
||||
#define etherSpi hspi2
|
||||
#define debugUart huart1
|
||||
#define modemUart huart2
|
||||
#define mainsCnt htim1
|
||||
#define LED_Red_Pin GPIO_PIN_13
|
||||
#define LED_Red_GPIO_Port GPIOC
|
||||
|
@ -97,11 +97,13 @@ C_SOURCES += \
|
||||
User/Src/ports.c \
|
||||
User/Src/wizHelper.c \
|
||||
User/Src/networkAbstractionLayer_lan.c
|
||||
NETWORK_STACK=1
|
||||
endif
|
||||
|
||||
ifeq ($(NETWORK), WiFi)
|
||||
C_SOURCES += \
|
||||
User/Src/networkAbstractionLayer_wifi.c
|
||||
NETWORK_STACK=2
|
||||
endif
|
||||
|
||||
# ASM sources
|
||||
@ -181,7 +183,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) -DVERSION="\"$(VERSION)\"" -Wall -Werror -fdata-sections -ffunction-sections
|
||||
CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -DNETWORK=$(NETWORK_STACK) -DVERSION="\"$(VERSION)\"" -Wall -Werror -fdata-sections -ffunction-sections
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
CFLAGS += -g -gdwarf-2
|
||||
|
@ -68,6 +68,11 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart) {
|
||||
debugTxCpltCallback(huart);
|
||||
}
|
||||
#endif //LOGGER_OUTPUT_BY_INTERRUPT
|
||||
#if NETWORK_STACK == 2
|
||||
if (huart == &modemUart) {
|
||||
modemTxCpltCallback(huart);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void HAL_SPI_TxCpltCallback(SPI_HandleTypeDef *hspi) {
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include <networkAbstractionLayer_impl.h>
|
||||
#include <logger.h>
|
||||
#include <utils.h>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@ -15,5 +16,7 @@ int8_t networkUdpSend(char *hostname, uint16_t port, uint8_t *buf, uint16_t bufL
|
||||
}
|
||||
|
||||
void networkImplInit() {
|
||||
|
||||
HAL_GPIO_WritePin(MODEM_RES_GPIO_Port, MODEM_RES_Pin, GPIO_PIN_RESET);
|
||||
activeDelay(500);
|
||||
HAL_GPIO_WritePin(MODEM_RES_GPIO_Port, MODEM_RES_Pin, GPIO_PIN_SET);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user