From ea044c6046f8c03fef633bdba7d229cb5fe8b4ea Mon Sep 17 00:00:00 2001 From: "zhanglu@realtek-sg.com" Date: Thu, 27 Dec 2018 13:35:32 +0800 Subject: [PATCH] realtek-rtl8195am-Hide_Debugging_Messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR addresses the issue of #8903. A new boolean variable 'debug' is added to turn off the display of debugging message (by default). It can be turned on when needed. Description 1. Add new boolean parameter ‘debug’ in function ‘RTWInterface’ in file "RTWInterface.h". 2. Add conditional statement to enable/disable variable ‘GlobalDebugEnable’ in file "RTWInterface.h" to control whether debugging message should be displayed. --- targets/TARGET_Realtek/TARGET_AMEBA/RTWInterface.cpp | 4 +++- targets/TARGET_Realtek/TARGET_AMEBA/RTWInterface.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/targets/TARGET_Realtek/TARGET_AMEBA/RTWInterface.cpp b/targets/TARGET_Realtek/TARGET_AMEBA/RTWInterface.cpp index 433f0d8afd..30f589511c 100644 --- a/targets/TARGET_Realtek/TARGET_AMEBA/RTWInterface.cpp +++ b/targets/TARGET_Realtek/TARGET_AMEBA/RTWInterface.cpp @@ -85,11 +85,13 @@ static rtw_result_t scan_result_handler( rtw_scan_handler_result_t* malloced_sca return RTW_SUCCESS; } -RTWInterface::RTWInterface(RTW_EMAC &get_rtw_emac, OnboardNetworkStack &get_rtw_obn_stack) : +RTWInterface::RTWInterface(RTW_EMAC &get_rtw_emac, OnboardNetworkStack &get_rtw_obn_stack, bool debug) : EMACInterface(get_rtw_emac, get_rtw_obn_stack), rtw_emac(get_rtw_emac), rtw_obn_stack(get_rtw_obn_stack) { + extern __u32 GlobalDebugEnable; + GlobalDebugEnable = debug?1:0; //Conditional statement: display debugging message rtw_emac.power_up(); } diff --git a/targets/TARGET_Realtek/TARGET_AMEBA/RTWInterface.h b/targets/TARGET_Realtek/TARGET_AMEBA/RTWInterface.h index 5a79782072..06a9328bdc 100644 --- a/targets/TARGET_Realtek/TARGET_AMEBA/RTWInterface.h +++ b/targets/TARGET_Realtek/TARGET_AMEBA/RTWInterface.h @@ -40,7 +40,7 @@ public: */ RTWInterface( RTW_EMAC &rtw_emac = RTW_EMAC::get_instance(), - OnboardNetworkStack &rtw_lwip_stack = OnboardNetworkStack::get_default_instance()); + OnboardNetworkStack &rtw_lwip_stack = OnboardNetworkStack::get_default_instance(), bool debug=false); ~RTWInterface();