File tree Expand file tree Collapse file tree 5 files changed +23
-2
lines changed Expand file tree Collapse file tree 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) {
460460\return Current status of the nRESET DAP hardware I/O pin.
461461*/
462462__STATIC_FORCEINLINE uint32_t PIN_nRESET_IN (void ) {
463+ #ifdef PROBE_PIN_RESET
464+ return probe_reset_level ();
465+ #else
463466 return (0U );
467+ #endif
464468}
465469
466470/** nRESET I/O pin: Set Output.
@@ -469,7 +473,11 @@ __STATIC_FORCEINLINE uint32_t PIN_nRESET_IN (void) {
469473 - 1: release device hardware reset.
470474*/
471475__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
473481}
474482
475483///@}
Original file line number Diff line number Diff line change 3838/* Include CDC interface to bridge to target UART. Omit if not used. */
3939#define PROBE_CDC_UART
4040/* Target reset GPIO (active-low). Omit if not used.*/
41- #define PROBE_PIN_RESET 0
41+ #define PROBE_PIN_RESET 1
4242
4343#define PROBE_SM 0
4444#define PROBE_PIN_OFFSET 12
Original file line number Diff line number Diff line change 3535#define PROBE_PIN_SWCLK (PROBE_PIN_OFFSET + 0) // 2
3636#define PROBE_PIN_SWDIO (PROBE_PIN_OFFSET + 1) // 3
3737// Target reset config
38+ #if false
3839#define PROBE_PIN_RESET 1
40+ #endif
3941
4042// UART config
4143#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)
7676#endif
7777}
7878
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+
7988typedef enum probe_pio_command {
8089 CMD_WRITE = 0 ,
8190 CMD_SKIP ,
Original file line number Diff line number Diff line change @@ -46,5 +46,7 @@ void probe_write_mode(void);
4646
4747void probe_init (void );
4848void probe_deinit (void );
49+ void probe_assert_reset (bool state );
50+ int probe_reset_level (void );
4951
5052#endif
You can’t perform that action at this time.
0 commit comments