fix & update

This commit is contained in:
pvvx 2017-02-01 14:57:01 +03:00
parent 0557a41f1a
commit 741520fa66
58 changed files with 6620 additions and 6810 deletions

View file

@ -76,10 +76,38 @@ void fATE1(void *arg)
printf("[ATE0]Usage to set wlan as default interface: ATE1=0\n");
}
}
/*
void fATTT(void *arg){
#if 1
ConfigDebugErr = -1;
ConfigDebugInfo = ~(_DBG_GDMA_ | _DBG_SPI_FLASH_);
ConfigDebugWarn = -1;
CfgSysDebugErr = -1;
CfgSysDebugInfo = -1;
CfgSysDebugWarn = -1;
#endif
printf("ethernet_init = %d\n", ethernet_mii_init()); // ethernet_init()); // HalMiiInit()); //HalMiiInitRtl8195a();
}
void fATT1(void *arg){
#if 1
ConfigDebugErr = -1;
ConfigDebugInfo = ~(_DBG_GDMA_ | _DBG_SPI_FLASH_);
ConfigDebugWarn = -1;
CfgSysDebugErr = -1;
CfgSysDebugInfo = -1;
CfgSysDebugWarn = -1;
#endif
printf("ethernet_write = %d\n", ethernet_write((const char *)0x1000, 1024));
printf("ethernet_send = %d\n", ethernet_send());
}
*/
log_item_t at_ethernet_items[ ] = {
{"ATE0", fATE0,},
{"ATE1", fATE1,}
{"ATE0", fATE0},
// {"ATTT", fATTT}, // Test !
// {"ATT1", fATT1}, // Test !
{"ATE1", fATE1}
};
void at_ethernet_init(void)
@ -89,4 +117,4 @@ void at_ethernet_init(void)
log_module_init(at_ethernet_init);
#endif
#endif

File diff suppressed because it is too large Load diff

View file

@ -2593,57 +2593,6 @@ void print_wlan_help(void *arg){
}
#endif // end of #if ATCMD_VER == ATVER_1
#endif // end of #if CONFIG_WLAN
#if CONFIG_LWIP_LAYER
#if ATCMD_VER == ATVER_1
void fATWL(void *arg){
#if CONFIG_SSL_CLIENT
int argc;
char *argv[MAX_ARGC] = {0};
printf("[ATWL]: _AT_WLAN_SSL_CLIENT_\n");
argv[0] = "ssl_client";
if(!arg){
printf("ATWL=SSL_SERVER_HOST\n");
return;
}
if((argc = parse_param(arg, argv)) > 1){
if(argc != 2) {
printf("ATWL=SSL_SERVER_HOST\n");
return;
}
cmd_ssl_client(argc, argv);
}
#else
printf("Please set CONFIG_SSL_CLIENT 1 in platform_opts.h to enable ATWL command\n");
#endif
}
void fATWI(void *arg){
int argc;
char *argv[MAX_ARGC] = {0};
printf("[ATWI]: _AT_WLAN_PING_TEST_\n");
if(!arg){
printf("[ATWI] Usage: ATWI=[host],[options]\n");
printf(" -t Ping the specified host until stopped\n");
printf(" -n # Number of echo requests to send (default 4 times)\n");
printf(" -l # Send buffer size (default 32 bytes)\n");
printf(" Example:\n");
printf(" ATWI=192.168.1.2,-n,100,-l,5000\n");
return;
}
argv[0] = "ping";
if((argc = parse_param(arg, argv)) > 1){
cmd_ping(argc, argv);
}
}
void fATWT(void *arg)
{
#if CONFIG_BSD_TCP
@ -2719,6 +2668,57 @@ void fATWU(void *arg)
printf("Please set CONFIG_BSD_TCP 1 in platform_opts.h to enable ATWU command\n");
#endif
}
#endif // end of #if CONFIG_WLAN
#if CONFIG_LWIP_LAYER
#if ATCMD_VER == ATVER_1
void fATWL(void *arg){
#if CONFIG_SSL_CLIENT
int argc;
char *argv[MAX_ARGC] = {0};
printf("[ATWL]: _AT_WLAN_SSL_CLIENT_\n");
argv[0] = "ssl_client";
if(!arg){
printf("ATWL=SSL_SERVER_HOST\n");
return;
}
if((argc = parse_param(arg, argv)) > 1){
if(argc != 2) {
printf("ATWL=SSL_SERVER_HOST\n");
return;
}
cmd_ssl_client(argc, argv);
}
#else
printf("Please set CONFIG_SSL_CLIENT 1 in platform_opts.h to enable ATWL command\n");
#endif
}
void fATWI(void *arg){
int argc;
char *argv[MAX_ARGC] = {0};
printf("[ATWI]: _AT_WLAN_PING_TEST_\n");
if(!arg){
printf("[ATWI] Usage: ATWI=[host],[options]\n");
printf(" -t Ping the specified host until stopped\n");
printf(" -n # Number of echo requests to send (default 4 times)\n");
printf(" -l # Send buffer size (default 32 bytes)\n");
printf(" Example:\n");
printf(" ATWI=192.168.1.2,-n,100,-l,5000\n");
return;
}
argv[0] = "ping";
if((argc = parse_param(arg, argv)) > 1){
cmd_ping(argc, argv);
}
}
#elif ATCMD_VER == ATVER_2 // uart at command
//move to atcmd_lwip.c
#endif
@ -2813,6 +2813,10 @@ log_item_t at_wifi_items[ ] = {
{"ATWL", fATWL,}, //p2p listen
{"ATWP", fATWP,}, //p2p peers
#endif
#if CONFIG_LWIP_LAYER
{"ATWT", fATWT,},
{"ATWU", fATWU,},
#endif
#ifdef CONFIG_PROMISC
{"ATWM", fATWM,}, // WIFI promisc Usage: ATWM=DURATION_SECONDS[with_len]
#endif

View file

@ -23,6 +23,7 @@
extern int inic_start(void);
extern int inic_stop(void);
#endif
#include "wlan_lib.h"
#if CONFIG_DEBUG_LOG > 0
#undef printf

View file

@ -683,7 +683,7 @@ enum CUSTOM_IE_TYPE{
typedef struct _cus_ie{
__u8 *ie;
__u8 type;
}cus_ie, *p_cus_ie;
} cus_ie, *p_cus_ie;
#endif /* _CUS_IE_ */
int wifi_add_custom_ie(void *cus_ie, int ie_num);

View file

@ -86,6 +86,10 @@ static rtw_result_t rtw_indicate_event_handle(int event_cmd, char *buf, int buf_
return RTW_SUCCESS;
}
#endif
#if 0 // test beacon
#include "gpio_api.h" // mbed
extern gpio_t gpio_led;
#endif
void wifi_indication( WIFI_EVENT_INDICATE event, char *buf, int buf_len, int flags)
{
@ -194,6 +198,10 @@ void wifi_indication( WIFI_EVENT_INDICATE event, char *buf, int buf_len, int fla
#if(WIFI_INDICATE_MSG>1)
printf("%s(): WIFI_EVENT_BEACON_AFTER_DHCP\n", __func__);
#endif
#if 0 // test beacon
gpio_write(&gpio_led, 1);
gpio_write(&gpio_led, 0);
#endif
break;
}

View file

@ -160,11 +160,11 @@ void ethernet_demo(void* param){
printf("TRX pre setting done\n");
ethernet_init();
#if 0
DBG_INFO_MSG_OFF(_DBG_MII_);
DBG_WARN_MSG_OFF(_DBG_MII_);
DBG_ERR_MSG_ON(_DBG_MII_);
#endif
/*get mac*/
ethernet_address(mac);
memcpy((void*)xnetif[NET_IF_NUM - 1].hwaddr,(void*)mac, 6);
@ -172,7 +172,7 @@ void ethernet_demo(void* param){
rtw_init_sema(&mii_rx_sema,0);
rtw_mutex_init(&mii_tx_mutex);
if(xTaskCreate(mii_rx_thread, ((const char*)"mii_rx_thread"), 1024, NULL, tskIDLE_PRIORITY+5, NULL) != pdPASS)
if(xTaskCreate(mii_rx_thread, ((const char*)"mii_rx_th"), 1024, NULL, tskIDLE_PRIORITY+5, NULL) != pdPASS)
DBG_8195A("\n\r%s xTaskCreate(mii_rx_thread) failed", __FUNCTION__);
DBG_8195A("\nEthernet_mii Init done, interface %d",NET_IF_NUM - 1);
@ -191,11 +191,11 @@ void ethernet_mii_init()
ethernet_if_default = 1;
rtw_init_sema(&mii_linkup_sema,0);
if( xTaskCreate((TaskFunction_t)dhcp_start_mii, "DHCP_START_MII", 1024, NULL, 2, NULL) != pdPASS) {
if( xTaskCreate((TaskFunction_t)dhcp_start_mii, "DHCP_MII", 1024, NULL, 2, NULL) != pdPASS) {
DBG_8195A("Cannot create demo task\n\r");
}
if( xTaskCreate((TaskFunction_t)ethernet_demo, "ETHERNET DEMO", 1024, NULL, 2, NULL) != pdPASS) {
if( xTaskCreate((TaskFunction_t)ethernet_demo, "ETH_DEMO", 1024, NULL, 2, NULL) != pdPASS) {
DBG_8195A("Cannot create demo task\n\r");
}

View file

@ -5,6 +5,7 @@
*/
#include "rtl8195a.h"
#ifdef CONFIG_SDIO_HOST_EN
#include "sd.h"
#include "sdio_host.h"
@ -117,7 +118,7 @@ SD_RESULT SD_ReadBlocks(u32 sector, u8 *data, u32 count) {
u32 end_sector = count + sector;
while (sector < end_sector) {
rd_count = sdio_read_blocks(sector, buf, 1);
rtl_printf("rd_counts = %d\n", rd_count);
// rtl_printf("rd_counts = %d\n", rd_count);
if (rd_count == 0 && RtlDownSemaWithTimeout(&sdWSema, 1000) != 1) {
DBG_SDIO_ERR("SD_ReadBlocks timeout\n");
return SD_ERROR;
@ -172,3 +173,4 @@ SD_RESULT SD_WriteBlocks(u32 sector, const u8 *data, u32 count) {
return SD_ERROR;
}
#endif // CONFIG_SDIO_HOST_EN

View file

@ -5,6 +5,7 @@
*/
#include "rtl8195a.h"
#ifdef CONFIG_SDIO_HOST_EN
#include "sd.h"
#include "sdio_host.h"
#include "hal_sdio_host.h"
@ -45,13 +46,17 @@ void xfer_err_callback(void *param) {
}
void card_insert_callback(void *param) {
#if CONFIG_DEBUG_LOG > 1
rtl_printf("SD card insert\n");
#endif
if (card_insert_irq_handler)
card_insert_irq_handler((void *) card_insert_irq_data);
}
void card_remove_callback(void *param) {
#if CONFIG_DEBUG_LOG > 1
rtl_printf("SD card removed\n");
#endif
sdio_status = SDIO_SD_NONE;
if (card_remove_irq_handler)
card_remove_irq_handler((void *) card_remove_irq_data);
@ -208,7 +213,7 @@ s8 sdio_write_blocks(uint32_t sector, const uint8_t *buffer, uint32_t count) {
HAL_Status result = HalSdioHostOp.HalSdioHostWriteBlocksDma(
&SdioHostAdapter, (unsigned long long) sector * SIZE_BLOCK_ADMA,
count);
if (result) {
if (result != HAL_OK) {
DBG_SDIO_ERR("write fail(0x%02x)\n", result);
return -1;
}
@ -230,7 +235,7 @@ s8 sdio_sd_init(void) {
}
sdio_status = SDIO_SD_OK;
if (HalSdioHostOp.HalSdioHostChangeSdClock(&SdioHostAdapter,
SD_CLK_41_6MHZ))
SD_CLK_41_6MHZ) != HAL_OK)
DBG_SDIO_INFO("SD card does not support high speed.\n");
}
return 0;
@ -239,7 +244,7 @@ s8 sdio_sd_init(void) {
//-----
void sdio_sd_deinit() {
if (sdio_status > SDIO_SD_NONE)
sdio_status = 1;
sdio_status = SDIO_INIT_OK;
sdio_deinit_host(); // add pvvx (fix SD_DeInit())
}
@ -400,3 +405,4 @@ s8 sdio_sd_hook_xfer_err_cb(sdio_sd_irq_handler CallbackFun, void *param) {
return 0;
}
#endif // CONFIG_SDIO_HOST_EN

View file

@ -326,7 +326,7 @@ typedef enum {
RTW_COUNTRY_MAX
}rtw_country_code_t;
} rtw_country_code_t;
typedef enum {
RTW_ADAPTIVITY_DISABLE = 0,
@ -341,14 +341,15 @@ typedef enum {
RTW_MODE_AP,
RTW_MODE_STA_AP,
RTW_MODE_PROMISC,
RTW_MODE_P2P
}rtw_mode_t;
RTW_MODE_P2P,
RTW_MODE_MAX
} rtw_mode_t;
typedef enum {
RTW_SCAN_FULL = 0,
RTW_SCAN_SOCIAL,
RTW_SCAN_ONE
}rtw_scan_mode_t;
} rtw_scan_mode_t;
typedef enum {
RTW_LINK_DISCONNECTED = 0,
@ -421,7 +422,7 @@ typedef enum{
RTW_WRONG_PASSWORD = 3 ,
RTW_DHCP_FAIL = 4,
RTW_UNKNOWN,
}rtw_connect_error_flag_t;
} rtw_connect_error_flag_t;
typedef enum {
RTW_TX_PWR_PERCENTAGE_100 = 0, /* 100%, default target output power. */
@ -429,7 +430,7 @@ typedef enum {
RTW_TX_PWR_PERCENTAGE_50 = 2, /* 50% */
RTW_TX_PWR_PERCENTAGE_25 = 3, /* 25% */
RTW_TX_PWR_PERCENTAGE_12_5 = 4, /* 12.5% */
}rtw_tx_pwr_percentage_t;
} rtw_tx_pwr_percentage_t;
typedef enum _WIFI_EVENT_INDICATE{
WIFI_EVENT_CONNECT = 0,

View file

@ -80,7 +80,7 @@ typedef struct rtw_wifi_setting {
rtw_security_t security_type;
unsigned char password[65];
unsigned char key_idx;
}rtw_wifi_setting_t;
} rtw_wifi_setting_t;
#if defined(__IAR_SYSTEMS_ICC__)
#pragma pack()
#endif

View file

@ -38,19 +38,19 @@ extern int rtw_wx_set_freq(struct net_device *dev, struct iw_request_info *info,
extern int rtw_ex_set(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wdata, char *extra);
extern void wireless_send_event(struct net_device *dev, unsigned int cmd, union iwreq_data *wrqu, char *extra);
extern void indicate_wx_custom_event(_adapter *padapter, char *msg);
extern void indicate_wx_scan_result_present(__int64 padapter, __int64 a2);
extern void indicate_wx_scan_complete_event(__int64 padapter, __int64 a2);
extern void rtw_indicate_sta_assoc(__int64 padapter, __int64 buf);
extern void indicate_wx_scan_result_present(uint64_t padapter, uint64_t a2);
extern void indicate_wx_scan_complete_event(uint64_t padapter, uint64_t a2);
extern void rtw_indicate_sta_assoc(uint64_t padapter, uint64_t buf);
extern void rtw_indicate_sta_disassoc(_adapter *padapter, uint8_t *addr);
extern void rtw_indicate_wx_assoc_event(__int64 padapter, __int64 a2);
extern void rtw_indicate_wx_disassoc_event(__int64 padapter, __int64 a2);
extern void rtw_indicate_wx_assoc_event(uint64_t padapter, uint64_t a2);
extern void rtw_indicate_wx_disassoc_event(uint64_t padapter, uint64_t a2);
extern int rtw_set_wpa_ie(_adapter *padapter, char *pie, int ielen);
extern void strtopsk(uint8_t *des, uint8_t *src, int len);
extern int rtw_wx_get_passphrase(struct net_device *dev, struct iw_request_info *a, union iwreq_data *wrqu, char *extra);
extern int rtw_wx_set_ap_essid(struct net_device *dev, struct iw_request_info *a, union iwreq_data *wrqu, char *extra);
extern void mac_reg_dump(_adapter *padapter);
extern void bb_reg_dump(_adapter *padapter);
extern void rf_reg_dump(_adapter *padapter, int a2, int a3);
extern void rf_reg_dump(_adapter *padapter); // , int a2, int a3);
extern int rtw_dbg_port(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra);
extern int rtw_get_auto_channel(struct net_device *dev, u8 *channel_set, int channel_num);
extern int rtw_set_sta_num(int ap_sta_num);
@ -277,7 +277,7 @@ extern int max_timer_used_num;
//--------------------------------
// rtl8195a_cmd.o
// Function declarations
extern int32_t FillH2CCmd8195A(PADAPTER padapter, int ElementID, __int64 CmdLen);
extern int32_t FillH2CCmd8195A(PADAPTER padapter, int ElementID, uint64_t CmdLen);
extern void rtl8195a_set_FwRsvdPage_cmd(PADAPTER padapter, PH2CParam_RsvdPage pRsvdPage);
extern void rtl8195a_set_FwMediaStatusRpt_cmd(PADAPTER padapter, int mstatus, int macid);
extern void rtl8195a_set_FwMacIdConfig_cmd(_adapter *padapter, int mac_id, int raid, int bw, uint8_t sgi, uint32_t mask);
@ -1082,12 +1082,12 @@ extern signed int OnProbeReq(_adapter *padapter, union recv_frame *precv_frame);
extern void issue_probereq(_adapter *padapter, NDIS_802_11_SSID *pssid, int blnbc);
extern void issue_auth(_adapter *padapter, struct sta_info *psta, int status);
extern signed int OnAuth(_adapter *padapter, union recv_frame *precv_frame);
extern void issue_asocrsp(_adapter *padapter, unsigned __int16 status, struct sta_info *pstat, int pkt_type);
extern void issue_asocrsp(_adapter *padapter, uint16_t status, struct sta_info *pstat, int pkt_type);
extern void issue_assocreq(_adapter *padapter);
extern void issue_nulldata(_adapter *padapter, unsigned int power_mode);
extern void issue_qos_nulldata(_adapter *padapter, u8 *da, uint16_t tid);
extern void issue_deauth(_adapter *padapter, u8 *da, uint32_t reason);
extern void issue_action_BA(_adapter *padapter, u8 *raddr, u8 action, unsigned __int16 status);
extern void issue_action_BA(_adapter *padapter, u8 *raddr, u8 action, uint16_t status);
extern signed int OnAction_back(_adapter *padapter, union recv_frame *precv_frame);
extern signed int send_beacon(_adapter *padapter);
extern signed int collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSID_EX *bssid);
@ -1101,8 +1101,8 @@ extern signed int OnProbeRsp(_adapter *padapter, union recv_frame *precv_frame);
extern void report_surveydone_event(_adapter *padapter);
extern void report_join_res(_adapter *padapter, int res);
extern signed int OnAssocRsp(_adapter *padapter, union recv_frame *precv_frame);
extern void report_del_sta_event(_adapter *padapter, u8 *MacAddr, unsigned __int16 reason);
extern signed int receive_disconnect(_adapter *padapter, u8 *MacAddr, unsigned __int16 reason);
extern void report_del_sta_event(_adapter *padapter, u8 *MacAddr, uint16_t reason);
extern signed int receive_disconnect(_adapter *padapter, u8 *MacAddr, uint16_t reason);
extern signed int OnBeacon(_adapter *padapter, union recv_frame *precv_frame);
extern signed int OnDeAuth(_adapter *padapter, union recv_frame *precv_frame);
extern signed int OnDisassoc(_adapter *padapter, union recv_frame *precv_frame);
@ -1240,7 +1240,7 @@ extern void (*promisc_callback)(u8 *, unsigned int, void *);
//--------------------------------
// rtw_psk.o
// Function declarations
extern void SetEAPOL_KEYIV(OCTET_STRING ocDst, __int64 a2, OCTET32_INTEGER oc32Counter);
extern void SetEAPOL_KEYIV(OCTET_STRING ocDst, uint64_t a2, OCTET32_INTEGER oc32Counter);
extern void ToDrv_SetPTK(_adapter *padapter, struct sta_info *psta);
extern void Message_ReplayCounter_OC2LI(int a1, LARGE_INTEGER *li);
extern int Message_SmallerEqualReplayCounter(LARGE_INTEGER li1, int a2);
@ -1402,7 +1402,7 @@ extern void rtw_txframes_update_attrib_vcs_info(_adapter *padapter, struct xmit_
extern int rtw_calculate_wlan_pkt_size_by_attribue(struct pkt_attrib *pattrib);
extern int32_t rtw_put_snap(uint8_t *data, int h_proto);
extern void rtw_update_protection(_adapter *padapter, uint8_t *ie, unsigned int ie_len);
extern void rtw_count_tx_stats(PADAPTER padapter, struct xmit_frame *pxmitframe, __int64 sz);
extern void rtw_count_tx_stats(PADAPTER padapter, struct xmit_frame *pxmitframe, uint64_t sz);
extern int32_t rtw_free_xmitbuf_ext(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf, int a3);
extern struct list_head *rtw_alloc_xmitframe(struct xmit_priv *pxmitpriv, _irqL a2);
extern int32_t rtw_free_xmitframe(struct xmit_priv *pxmitpriv, struct xmit_frame *pxmitframe);

View file

@ -412,7 +412,7 @@ typedef struct {
unsigned char mac[6];
} Rltk_wlan_t;
#define netdev_priv(dev) dev->priv
#define netdev_priv(dev) dev->priv
extern struct net_device *alloc_etherdev(int sizeof_priv);
void free_netdev(struct net_device *dev);

View file

@ -412,7 +412,7 @@ typedef long long __i64;
#define IWEVTXDROP 0x8C00 /* Packet dropped to excessive retry */
#define IWEVQUAL 0x8C01 /* Quality part of statistics (scan) */
#define IWEVCUSTOM 0x8C02 /* Driver specific ascii string */
#define IWEVREGISTERED 0x8C03 /* Discovered a new node (AP mode) */
#define IWEVREGISTERED 0x8C03 /* Discovered a new node (AP mode) */
#define IWEVEXPIRED 0x8C04 /* Expired a node (AP mode) */
#define IWEVGENIE 0x8C05 /* Generic IE (WPA, RSN, WMM, ..)
* (scan results); This includes id and

View file

@ -37,6 +37,9 @@ struct sk_buff {
*/
/************************************************************/
// #include "wrapper.h"
extern struct net_device *rltk_wlan_info;
//----- ------------------------------------------------------------------
// Wlan Interface opened for upper layer
//----- ------------------------------------------------------------------
@ -55,7 +58,6 @@ int rltk_wlan_set_wps_phase(unsigned char is_trigger_wps);
int rtw_ps_enable(int enable);
int rltk_wlan_is_connected_to_ap(void);
#ifdef __cplusplus
}
#endif

View file

@ -301,6 +301,11 @@ void gpio_uart_at_rx_irq_callback (uint32_t id, gpio_irq_event event)
void uart_at_rx_wakeup()
{
gpio_irq_t gpio_rx_wake;
#ifdef RTL8711AM
#if (UART_AT_RX_WAKE!=PA_0)||(UART_AT_RX_WAKE!=PE_3)
#error "Set pin rx_wakeup!"
#endif
#endif
gpio_irq_init(&gpio_rx_wake, UART_AT_RX_WAKE, gpio_uart_at_rx_irq_callback, 0);
gpio_irq_set(&gpio_rx_wake, IRQ_FALL, 1); // Falling Edge Trigger
gpio_irq_enable(&gpio_rx_wake);

View file

@ -13,27 +13,34 @@
#include "osdep_api.h"
#if 0// defined(RTL8710AF)
#if defined(RTL8710AF)
// RTL8710AF
#define UART_TX PA_4 // PC_3
#define UART_RX PA_0 // PC_0
#define UART_TX PA_4 // PC_3
#define UART_RX PA_0 // PC_0
#define UART_RTS PA_2 // PC_2
#define UART_CTS PA_1 // PC_1
#elif defined(RTL8711AM)
#elif 0 // defined(RTL8711AM)
// RTL8711AM
#define UART_TX PA_7
#define UART_RX PA_6
#define UART_TX PA_7
#define UART_RX PA_6 // no Interrupt!
#define UART_RTS PA_3
#define UART_CTS PA_5
#else
#elif 0 // else
// RTL8711AM + RTL8710AF
#define UART_TX PC_3
#define UART_RX PC_0
#define UART_TX PC_3
#define UART_RX PC_0 // no Interrupt!
#define UART_RTS PC_2
#define UART_CTS PC_1
#elif defined(RTL8711AM)
// RTL8711AM + RTL8710AF
#define UART_TX PE_0
#define UART_RX PE_3
#define UART_RTS PE_1
#define UART_CTS PE_2
#endif
#define KEY_ENTER 0xd

View file

@ -55,7 +55,6 @@ DRESULT SD_disk_read(BYTE *buff, DWORD sector, UINT count){
#if _USE_WRITE == 1
DRESULT SD_disk_write(const BYTE *buff, DWORD sector, UINT count){
SD_RESULT res;
res = SD_WriteBlocks(sector, buff, count);
return interpret_sd_result(res);

View file

@ -45,7 +45,7 @@
/* To enable fast seek feature, set _USE_FASTSEEK to 1. */
#define _USE_LABEL 0 /* 0:Disable or 1:Enable */
#define _USE_LABEL 1 /* 0:Disable or 1:Enable */
/* To enable volume label functions, set _USE_LAVEL to 1 */
@ -57,7 +57,7 @@
/ Locale and Namespace Configurations
/---------------------------------------------------------------------------*/
#define _CODE_PAGE 437
#define _CODE_PAGE 866 // 437
/* The _CODE_PAGE specifies the OEM code page to be used on the target system.
/ Incorrect setting of the code page can cause a file open failure.
/

View file

@ -2568,7 +2568,6 @@ FRESULT f_read (
UINT rcnt, cc;
BYTE csect, *rbuff = (BYTE*)buff;
*br = 0; /* Clear read byte counter */
res = validate(fp); /* Check validity */
@ -2670,9 +2669,10 @@ FRESULT f_write (
const BYTE *wbuff = (const BYTE*)buff;
BYTE csect;
*bw = 0; /* Clear write byte counter */
// rtl_printf("f_write(%p, %p, %d) = %d\n", fp, buff, btw);
res = validate(fp); /* Check validity */
if (res != FR_OK) LEAVE_FF(fp->fs, res);
if (fp->err) /* Check error */
@ -2773,8 +2773,6 @@ FRESULT f_write (
}
/*-----------------------------------------------------------------------*/
/* Synchronize the File */
/*-----------------------------------------------------------------------*/