@@ -386,6 +386,10 @@ static inline int mg_mkdir(const char *path, mode_t mode) {
386
386
#define MG_PATH_MAX FILENAME_MAX
387
387
#endif
388
388
389
+ #ifndef MG_ENABLE_POSIX_FS
390
+ #define MG_ENABLE_POSIX_FS 1
391
+ #endif
392
+
389
393
#endif
390
394
391
395
@@ -499,6 +503,10 @@ typedef int socklen_t;
499
503
#define SIGPIPE 0
500
504
#endif
501
505
506
+ #ifndef MG_ENABLE_POSIX_FS
507
+ #define MG_ENABLE_POSIX_FS 1
508
+ #endif
509
+
502
510
#endif
503
511
504
512
@@ -782,12 +790,8 @@ struct timeval {
782
790
#endif
783
791
784
792
#ifndef MG_ENABLE_POSIX_FS
785
- #if defined(FOPEN_MAX)
786
- #define MG_ENABLE_POSIX_FS 1
787
- #else
788
793
#define MG_ENABLE_POSIX_FS 0
789
794
#endif
790
- #endif
791
795
792
796
#ifndef MG_INVALID_SOCKET
793
797
#define MG_INVALID_SOCKET (-1 )
@@ -3070,14 +3074,22 @@ struct mg_tcpip_driver_tm4c_data {
3070
3074
#endif
3071
3075
3072
3076
3073
- #if MG_ENABLE_TCPIP && defined(MG_ENABLE_DRIVER_W5500) && MG_ENABLE_DRIVER_W5500
3074
-
3075
- #endif
3076
-
3077
-
3078
- #if MG_ENABLE_TCPIP && defined(MG_ENABLE_DRIVER_XMC7) && MG_ENABLE_DRIVER_XMC7
3077
+ #if MG_ENABLE_TCPIP && defined(MG_ENABLE_DRIVER_XMC) && MG_ENABLE_DRIVER_XMC
3079
3078
3080
- struct mg_tcpip_driver_xmc7_data {
3079
+ struct mg_tcpip_driver_xmc_data {
3080
+ // 13.2.8.1 Station Management Functions
3081
+ // MDC clock divider (). MDC clock is derived from ETH MAC clock
3082
+ // It must not exceed 2.5MHz
3083
+ // ETH Clock range DIVIDER mdc_cr VALUE
3084
+ // --------------------------------------------
3085
+ // -1 <-- tell driver to guess the value
3086
+ // 60-100 MHz ETH Clock/42 0
3087
+ // 100-150 MHz ETH Clock/62 1
3088
+ // 20-35 MHz ETH Clock/16 2
3089
+ // 35-60 MHz ETH Clock/26 3
3090
+ // 150-250 MHz ETH Clock/102 4
3091
+ // 250-300 MHz ETH Clock/124 5
3092
+ // 110, 111 Reserved
3081
3093
int mdc_cr; // Valid values: -1, 0, 1, 2, 3, 4, 5
3082
3094
uint8_t phy_addr;
3083
3095
};
@@ -3087,45 +3099,31 @@ struct mg_tcpip_driver_xmc7_data {
3087
3099
#endif
3088
3100
3089
3101
#ifndef MG_DRIVER_MDC_CR
3090
- #define MG_DRIVER_MDC_CR 3
3102
+ #define MG_DRIVER_MDC_CR 4
3091
3103
#endif
3092
3104
3093
3105
#define MG_TCPIP_DRIVER_INIT (mgr ) \
3094
3106
do { \
3095
- static struct mg_tcpip_driver_xmc7_data driver_data_; \
3107
+ static struct mg_tcpip_driver_xmc_data driver_data_; \
3096
3108
static struct mg_tcpip_if mif_; \
3097
3109
driver_data_.mdc_cr = MG_DRIVER_MDC_CR; \
3098
3110
driver_data_.phy_addr = MG_TCPIP_PHY_ADDR; \
3099
3111
mif_.ip = MG_TCPIP_IP; \
3100
3112
mif_.mask = MG_TCPIP_MASK; \
3101
3113
mif_.gw = MG_TCPIP_GW; \
3102
- mif_.driver = &mg_tcpip_driver_xmc7 ; \
3114
+ mif_.driver = &mg_tcpip_driver_xmc ; \
3103
3115
mif_.driver_data = &driver_data_; \
3104
3116
MG_SET_MAC_ADDRESS (mif_.mac ); \
3105
3117
mg_tcpip_init (mgr, &mif_); \
3106
- MG_INFO ((" Driver: xmc7 , MAC: %M" , mg_print_mac, mif_.mac )); \
3118
+ MG_INFO ((" Driver: xmc , MAC: %M" , mg_print_mac, mif_.mac )); \
3107
3119
} while (0 )
3108
3120
3109
3121
#endif
3110
3122
3111
3123
3124
+ #if MG_ENABLE_TCPIP && defined(MG_ENABLE_DRIVER_XMC7) && MG_ENABLE_DRIVER_XMC7
3112
3125
3113
- #if MG_ENABLE_TCPIP && defined(MG_ENABLE_DRIVER_XMC) && MG_ENABLE_DRIVER_XMC
3114
-
3115
- struct mg_tcpip_driver_xmc_data {
3116
- // 13.2.8.1 Station Management Functions
3117
- // MDC clock divider (). MDC clock is derived from ETH MAC clock
3118
- // It must not exceed 2.5MHz
3119
- // ETH Clock range DIVIDER mdc_cr VALUE
3120
- // --------------------------------------------
3121
- // -1 <-- tell driver to guess the value
3122
- // 60-100 MHz ETH Clock/42 0
3123
- // 100-150 MHz ETH Clock/62 1
3124
- // 20-35 MHz ETH Clock/16 2
3125
- // 35-60 MHz ETH Clock/26 3
3126
- // 150-250 MHz ETH Clock/102 4
3127
- // 250-300 MHz ETH Clock/124 5
3128
- // 110, 111 Reserved
3126
+ struct mg_tcpip_driver_xmc7_data {
3129
3127
int mdc_cr; // Valid values: -1, 0, 1, 2, 3, 4, 5
3130
3128
uint8_t phy_addr;
3131
3129
};
@@ -3135,27 +3133,28 @@ struct mg_tcpip_driver_xmc_data {
3135
3133
#endif
3136
3134
3137
3135
#ifndef MG_DRIVER_MDC_CR
3138
- #define MG_DRIVER_MDC_CR 4
3136
+ #define MG_DRIVER_MDC_CR 3
3139
3137
#endif
3140
3138
3141
3139
#define MG_TCPIP_DRIVER_INIT (mgr ) \
3142
3140
do { \
3143
- static struct mg_tcpip_driver_xmc_data driver_data_; \
3141
+ static struct mg_tcpip_driver_xmc7_data driver_data_; \
3144
3142
static struct mg_tcpip_if mif_; \
3145
3143
driver_data_.mdc_cr = MG_DRIVER_MDC_CR; \
3146
3144
driver_data_.phy_addr = MG_TCPIP_PHY_ADDR; \
3147
3145
mif_.ip = MG_TCPIP_IP; \
3148
3146
mif_.mask = MG_TCPIP_MASK; \
3149
3147
mif_.gw = MG_TCPIP_GW; \
3150
- mif_.driver = &mg_tcpip_driver_xmc ; \
3148
+ mif_.driver = &mg_tcpip_driver_xmc7 ; \
3151
3149
mif_.driver_data = &driver_data_; \
3152
3150
MG_SET_MAC_ADDRESS (mif_.mac ); \
3153
3151
mg_tcpip_init (mgr, &mif_); \
3154
- MG_INFO ((" Driver: xmc , MAC: %M" , mg_print_mac, mif_.mac )); \
3152
+ MG_INFO ((" Driver: xmc7 , MAC: %M" , mg_print_mac, mif_.mac )); \
3155
3153
} while (0 )
3156
3154
3157
3155
#endif
3158
3156
3157
+
3159
3158
#ifdef __cplusplus
3160
3159
}
3161
3160
#endif
0 commit comments