git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@14990 27425a3e-05d8-49a3-a47f-9c15f0e5edd8

This commit is contained in:
Giovanni Di Sirio 2021-11-01 09:18:53 +00:00
parent d31efc6531
commit 1f49aa5cef
5 changed files with 21 additions and 11 deletions

View File

@ -51,4 +51,9 @@
#define LWIP_THREAD_PRIORITY (LOWPRIO) #define LWIP_THREAD_PRIORITY (LOWPRIO)
#endif #endif
/* HTTPD settings override.*/
#define LWIP_HTTPD_CUSTOM_FILES 1
#define LWIP_HTTPD_DYNAMIC_FILE_READ 1
#define LWIP_HTTPD_DYNAMIC_HEADERS 1
#endif /* LWIP_HDR_LWIPOPTS_H__ */ #endif /* LWIP_HDR_LWIPOPTS_H__ */

View File

@ -291,8 +291,8 @@
/* /*
* SDC driver system settings. * SDC driver system settings.
*/ */
#define STM32_SDC_USE_SDMMC1 TRUE #define STM32_SDC_USE_SDMMC1 FALSE
#define STM32_SDC_USE_SDMMC2 FALSE #define STM32_SDC_USE_SDMMC2 TRUE
#define STM32_SDC_SDMMC_UNALIGNED_SUPPORT TRUE #define STM32_SDC_SDMMC_UNALIGNED_SUPPORT TRUE
#define STM32_SDC_SDMMC_WRITE_TIMEOUT 1000 #define STM32_SDC_SDMMC_WRITE_TIMEOUT 1000
#define STM32_SDC_SDMMC_READ_TIMEOUT 1000 #define STM32_SDC_SDMMC_READ_TIMEOUT 1000

View File

@ -33,6 +33,8 @@
#define PORTAB_SDU1 SDU2 #define PORTAB_SDU1 SDU2
#define PORTAB_SDC1 SDCD2
#define PORTAB_BLINK_LED1 LINE_ARD_D13 #define PORTAB_BLINK_LED1 LINE_ARD_D13
/*===========================================================================*/ /*===========================================================================*/

View File

@ -24,10 +24,11 @@
#include "chprintf.h" #include "chprintf.h"
#include "shell.h" #include "shell.h"
#include "ff.h"
#include "lwipthread.h" #include "lwipthread.h"
#include "lwip/apps/httpd.h" #include "lwip/apps/httpd.h"
#include "httpd_fatfs.h"
#include "ff.h"
#include "portab.h" #include "portab.h"
#include "usbcfg.h" #include "usbcfg.h"
@ -208,7 +209,7 @@ static void InsertHandler(eventid_t id) {
* On insertion SDC initialization and FS mount. * On insertion SDC initialization and FS mount.
*/ */
#if HAL_USE_SDC #if HAL_USE_SDC
if (sdcConnect(&SDCD1)) if (sdcConnect(&PORTAB_SDC1))
#else #else
if (mmcConnect(&MMCD1)) if (mmcConnect(&MMCD1))
#endif #endif
@ -217,7 +218,7 @@ static void InsertHandler(eventid_t id) {
err = f_mount(&SDC_FS, "/", 1); err = f_mount(&SDC_FS, "/", 1);
if (err != FR_OK) { if (err != FR_OK) {
#if HAL_USE_SDC #if HAL_USE_SDC
sdcDisconnect(&SDCD1); sdcDisconnect(&PORTAB_SDC1);
#else #else
mmcDisconnect(&MMCD1); mmcDisconnect(&MMCD1);
#endif #endif
@ -233,7 +234,7 @@ static void RemoveHandler(eventid_t id) {
(void)id; (void)id;
#if HAL_USE_SDC #if HAL_USE_SDC
sdcDisconnect(&SDCD1); sdcDisconnect(&PORTAB_SDC1);
#else #else
mmcDisconnect(&MMCD1); mmcDisconnect(&MMCD1);
#endif #endif
@ -320,12 +321,12 @@ int main(void) {
* Activates the SDC driver 1 using default configuration. * Activates the SDC driver 1 using default configuration.
*/ */
sdcStart(&SDCD1, NULL); sdcStart(&PORTAB_SDC1, NULL);
/* /*
* Activates the card insertion monitor. * Activates the card insertion monitor.
*/ */
tmr_init(&SDCD1); tmr_init(&PORTAB_SDC1);
#else #else
/* /*
* Initializes the MMC driver to work with SPI3. * Initializes the MMC driver to work with SPI3.
@ -348,6 +349,7 @@ int main(void) {
/* /*
* Starts the HTTP server. * Starts the HTTP server.
*/ */
httpd_fatfs_init();
httpd_init(); httpd_init();
/* /*

View File

@ -5,7 +5,7 @@
# Compiler options here. # Compiler options here.
ifeq ($(USE_OPT),) ifeq ($(USE_OPT),)
USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 USE_OPT = -Og -ggdb -fomit-frame-pointer -falign-functions=16
endif endif
# C specific options here (added to USE_OPT). # C specific options here (added to USE_OPT).
@ -116,6 +116,7 @@ include $(CHIBIOS)/os/hal/lib/streams/streams.mk
include $(CHIBIOS)/os/various/shell/shell.mk include $(CHIBIOS)/os/various/shell/shell.mk
include $(CHIBIOS)/os/various/lwip_bindings/lwip.mk include $(CHIBIOS)/os/various/lwip_bindings/lwip.mk
include $(CHIBIOS)/os/various/fatfs_bindings/fatfs.mk include $(CHIBIOS)/os/various/fatfs_bindings/fatfs.mk
include $(CHIBIOS)/os/various/httpd_fatfs_bindings/httpd_fatfs.mk
# Define linker script file here # Define linker script file here
LDSCRIPT= $(STARTUPLD)/STM32F76xxI.ld LDSCRIPT= $(STARTUPLD)/STM32F76xxI.ld
@ -156,7 +157,7 @@ CPPWARN = -Wall -Wextra -Wundef
# #
# List all user C define here, like -D_DEBUG=1 # List all user C define here, like -D_DEBUG=1
UDEFS = UDEFS = -DFATFS_HAL_DEVICE=SDCD2
# Define ASM defines here # Define ASM defines here
UADEFS = UADEFS =