File tree 5 files changed +23
-2
lines changed 5 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -460,7 +460,11 @@ __STATIC_FORCEINLINE void PIN_nTRST_OUT (uint32_t bit) {
460
460
\return Current status of the nRESET DAP hardware I/O pin.
461
461
*/
462
462
__STATIC_FORCEINLINE uint32_t PIN_nRESET_IN (void ) {
463
+ #ifdef PROBE_PIN_RESET
464
+ return probe_reset_level ();
465
+ #else
463
466
return (0U );
467
+ #endif
464
468
}
465
469
466
470
/** nRESET I/O pin: Set Output.
@@ -469,7 +473,11 @@ __STATIC_FORCEINLINE uint32_t PIN_nRESET_IN (void) {
469
473
- 1: release device hardware reset.
470
474
*/
471
475
__STATIC_FORCEINLINE void PIN_nRESET_OUT (uint32_t bit ) {
472
- ;
476
+ #ifdef PROBE_PIN_RESET
477
+ probe_assert_reset (!!bit );
478
+ #else
479
+ (void ) bit ;
480
+ #endif
473
481
}
474
482
475
483
///@}
Original file line number Diff line number Diff line change 38
38
/* Include CDC interface to bridge to target UART. Omit if not used. */
39
39
#define PROBE_CDC_UART
40
40
/* Target reset GPIO (active-low). Omit if not used.*/
41
- #define PROBE_PIN_RESET 0
41
+ #define PROBE_PIN_RESET 1
42
42
43
43
#define PROBE_SM 0
44
44
#define PROBE_PIN_OFFSET 12
Original file line number Diff line number Diff line change 35
35
#define PROBE_PIN_SWCLK (PROBE_PIN_OFFSET + 0) // 2
36
36
#define PROBE_PIN_SWDIO (PROBE_PIN_OFFSET + 1) // 3
37
37
// Target reset config
38
+ #if false
38
39
#define PROBE_PIN_RESET 1
40
+ #endif
39
41
40
42
// UART config
41
43
#define PICOPROBE_UART_TX 4
Original file line number Diff line number Diff line change @@ -76,6 +76,15 @@ void probe_assert_reset(bool state)
76
76
#endif
77
77
}
78
78
79
+ int probe_reset_level (void )
80
+ {
81
+ #if defined(PROBE_PIN_RESET )
82
+ return gpio_get (PROBE_PIN_RESET );
83
+ #else
84
+ return 0 ;
85
+ #endif
86
+ }
87
+
79
88
typedef enum probe_pio_command {
80
89
CMD_WRITE = 0 ,
81
90
CMD_SKIP ,
Original file line number Diff line number Diff line change @@ -46,5 +46,7 @@ void probe_write_mode(void);
46
46
47
47
void probe_init (void );
48
48
void probe_deinit (void );
49
+ void probe_assert_reset (bool state );
50
+ int probe_reset_level (void );
49
51
50
52
#endif
You can’t perform that action at this time.
0 commit comments