Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
debug_lpc1114.cpp
00001 /* 00002 * mbed Application program 00003 * 00004 * Copyright (c) 2010-2014 Kenji Arai / JH1PJL 00005 * http://www.page.sannet.ne.jp/kenjia/index.html 00006 * http://mbed.org/users/kenjiArai/ 00007 * Created: May 15th, 2010 00008 * Spareted: June 25th, 2014 mon() & mon_hw() 00009 * Ported: September 22nd, 2014 from L152RE, LP1114 00010 * changed: October 15th, 2014 mon.cpp to debug_xxx.cpp 00011 * Revised: Nobember 2nd, 2014 00012 * 00013 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 00014 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 00015 * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 00016 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 00017 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00018 */ 00019 00020 #if defined(TARGET_LPC1114) 00021 00022 // Include --------------------------------------------------------------------------------------- 00023 #include "mbed.h" 00024 #include "debug_common.h" 00025 00026 // Object ---------------------------------------------------------------------------------------- 00027 00028 // Definition ------------------------------------------------------------------------------------ 00029 00030 // RAM ------------------------------------------------------------------------------------------- 00031 00032 // ROM / Constant data --------------------------------------------------------------------------- 00033 00034 // Function prototypes --------------------------------------------------------------------------- 00035 extern void cpu_inf (void); 00036 00037 //------------------------------------------------------------------------------------------------- 00038 // Control Program 00039 //------------------------------------------------------------------------------------------------- 00040 // Help Massage 00041 void msg_hlp (void) 00042 { 00043 PRINTF(mon_msg); 00044 put_rn(); 00045 PRINTF("1 - goto step1 -> no connection all pins"); 00046 put_rn(); 00047 PRINTF("2 - goto step2 -> connects pin_x and pin_y"); 00048 put_rn(); 00049 PRINTF("x - Goto HW monitor"); 00050 put_rn(); 00051 PRINTF("q - Return to main"); 00052 put_rn(); 00053 } 00054 00055 // ---------- Program starts here! --------------------------------------------------------------- 00056 void debug_interface(void) 00057 { 00058 char *ptr; 00059 uint8_t quitflag; 00060 00061 BAUD(BAUD_RATE); 00062 put_rn(); 00063 put_rn(); 00064 PRINTF("%s [Help:'?' key]", mon_msg); 00065 put_rn(); 00066 for (;;) { 00067 put_r(); 00068 PUTC('>'); 00069 ptr = linebuf; 00070 get_line(ptr, sizeof(linebuf)); 00071 switch (*ptr++) { 00072 //--------------------------------------------------------------------------------- 00073 // Debug Step1 00074 //--------------------------------------------------------------------------------- 00075 case '1' : 00076 put_r(); 00077 PRINTF("Enter Step1: no connection all pins"); 00078 put_rn(); 00079 quitflag = 0; 00080 for (; quitflag != 0xff;) { 00081 PRINTF("1>"); 00082 ptr = linebuf; 00083 get_line(ptr, buf_size); 00084 put_r(); 00085 switch(*ptr++) { 00086 case 's' : 00087 PRINTF("----- CPU CLOCK Information -----"); 00088 put_rn(); 00089 get_freq(1); 00090 PRINTF("----- CPU TYPE Information ------"); 00091 put_rn(); 00092 cpu_inf(); 00093 break; 00094 case '?' : 00095 PRINTF("s - CPU system info & clock"); 00096 put_rn(); 00097 PRINTF("q - Return to all mode"); 00098 put_rn(); 00099 PRINTF("? - You know this"); 00100 put_rn(); 00101 break; 00102 case 'q' : // quit 00103 PRINTF("Back to all mode"); 00104 quitflag = 0xff; 00105 break; 00106 default: 00107 PUTC('?'); 00108 put_rn(); 00109 } 00110 } 00111 put_rn(); 00112 break; 00113 //--------------------------------------------------------------------------------- 00114 // help 00115 //--------------------------------------------------------------------------------- 00116 case '?' : 00117 put_r(); 00118 msg_hlp(); 00119 break; 00120 //--------------------------------------------------------------------------------- 00121 // Go to special command 00122 //--------------------------------------------------------------------------------- 00123 case 'x' : 00124 mon_hw(); 00125 PRINTF("->Came back monitor\r\n"); 00126 break; 00127 //--------------------------------------------------------------------------------- 00128 // Go back to main() 00129 //--------------------------------------------------------------------------------- 00130 case 'q' : // Quit 00131 PRINTF("\rReturn to main\r\n"); 00132 //PRINTF("cannot control anymore from here\r\n"); 00133 return; 00134 //--------------------------------------------------------------------------------- 00135 // no support 00136 //--------------------------------------------------------------------------------- 00137 default: 00138 put_r(); 00139 PUTC('?'); 00140 put_rn(); 00141 break; 00142 } 00143 } 00144 } 00145 00146 #endif // defined(TARGET_LPC1114)
Generated on Thu Jul 14 2022 02:12:15 by
1.7.2