1 /*********************************************************************
2 *                    SEGGER Microcontroller GmbH                     *
3 *                        The Embedded Experts                        *
4 **********************************************************************
5 *                                                                    *
6 *            (c) 1995 - 2018 SEGGER Microcontroller GmbH             *
7 *                                                                    *
8 *       www.segger.com     Support: support@segger.com               *
9 *                                                                    *
10 **********************************************************************
11 *                                                                    *
12 * All rights reserved.                                               *
13 *                                                                    *
14 * SEGGER strongly recommends to not make any changes                 *
15 * to or modify the source code of this software in order to stay     *
16 * compatible with the monitor mode protocol and J-Link.              *
17 *                                                                    *
18 * Redistribution and use in source and binary forms, with or         *
19 * without modification, are permitted provided that the following    *
20 * conditions are met:                                                *
21 *                                                                    *
22 * - Redistributions of source code must retain the above copyright   *
23 *   notice, this list of conditions and the following disclaimer.    *
24 *                                                                    *
25 * - Redistributions in binary form must reproduce the above          *
26 *   copyright notice, this list of conditions and the following      *
27 *   disclaimer in the documentation and/or other materials provided  *
28 *   with the distribution.                                           *
29 *                                                                    *
30 * - Neither the name of SEGGER Microcontroller GmbH                  *
31 *   nor the names of its contributors may be used to endorse or      *
32 *   promote products derived from this software without specific     *
33 *   prior written permission.                                        *
34 *                                                                    *
35 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND             *
36 * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,        *
37 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF           *
38 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE           *
39 * DISCLAIMED. IN NO EVENT SHALL SEGGER Microcontroller BE LIABLE FOR *
40 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR           *
41 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT  *
42 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;    *
43 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF      *
44 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT          *
45 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE  *
46 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH   *
47 * DAMAGE.                                                            *
48 *                                                                    *
49 **********************************************************************
50 ----------------------------------------------------------------------
51 File    : JLINK_MONITOR.c
52 Purpose : Implementation of debug monitor for J-Link monitor mode debug on Cortex-M devices.
53 --------  END-OF-HEADER  ---------------------------------------------
54 */
55 
56 #include "JLINK_MONITOR.h"
57 
58 /*********************************************************************
59 *
60 *       Configuration
61 *
62 **********************************************************************
63 */
64 
65 /*********************************************************************
66 *
67 *       Defines
68 *
69 **********************************************************************
70 */
71 
72 /*********************************************************************
73 *
74 *       Types
75 *
76 **********************************************************************
77 */
78 
79 /*********************************************************************
80 *
81 *       Static data
82 *
83 **********************************************************************
84 */
85 
86 /*********************************************************************
87 *
88 *       Local functions
89 *
90 **********************************************************************
91 */
92 
93 /*********************************************************************
94 *
95 *       Global functions
96 *
97 **********************************************************************
98 */
99 
100 
101 /*********************************************************************
102 *
103 *       JLINK_MONITOR_OnExit()
104 *
105 *  Function description
106 *    Called from DebugMon_Handler(), once per debug exit.
107 *    May perform some target specific operations to be done on debug mode exit.
108 *
109 *  Notes
110 *    (1) Must not keep the CPU busy for more than 100 ms
111 */
JLINK_MONITOR_OnExit(void)112 void JLINK_MONITOR_OnExit(void) {
113   //
114   // Add custom code here
115   //
116 //  BSP_ClrLED(0);
117 }
118 
119 /*********************************************************************
120 *
121 *       JLINK_MONITOR_OnEnter()
122 *
123 *  Function description
124 *    Called from DebugMon_Handler(), once per debug entry.
125 *    May perform some target specific operations to be done on debug mode entry
126 *
127 *  Notes
128 *    (1) Must not keep the CPU busy for more than 100 ms
129 */
130 
JLINK_MONITOR_OnEnter(void)131 void JLINK_MONITOR_OnEnter(void) {
132   // Add custom code here
133   //
134 //  BSP_SetLED(0);
135 //  BSP_ClrLED(1);
136 }
137 
138 /*********************************************************************
139 *
140 *       JLINK_MONITOR_OnPoll()
141 *
142 *  Function description
143 *    Called periodically from DebugMon_Handler(), to perform some actions that need to be performed periodically during debug mode.
144 *
145 *  Notes
146 *    (1) Must not keep the CPU busy for more than 100 ms
147 */
148 
JLINK_MONITOR_OnPoll(void)149 void JLINK_MONITOR_OnPoll(void) {
150 }
151 
152 /****** End Of File *************************************************/
153