Skip to content

Commit 76201f4

Browse files
committed
emb:esp32c3:implement _write by jtag output patch some comment
1 parent e6ae235 commit 76201f4

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

targets/device/esp/esp32c3.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ extern "C" {
1111
#endif
1212
#include "stdint.h"
1313

14+
// note(zzy): Structure definition from ESP-IDF:
15+
// components/soc/esp32c3/register/soc/usb_serial_jtag_struct.h
1416
typedef volatile struct usb_serial_jtag_dev_s {
1517
union {
1618
struct {
@@ -290,6 +292,9 @@ typedef volatile struct usb_serial_jtag_dev_s {
290292
} usb_serial_jtag_dev_t;
291293
extern usb_serial_jtag_dev_t USB_SERIAL_JTAG;
292294

295+
// note(zzy): Functions below are based on ESP-IDF HAL layer:
296+
// https://github.com/espressif/esp-idf/blob/release/v6.0/components/hal/esp32c3/include/hal/usb_serial_jtag_ll.h
297+
293298
/**
294299
* @brief Flushes the TX buffer, that is, make it available for the
295300
* host to pick up.
@@ -336,6 +341,8 @@ static inline int usb_serial_jtag_ll_write_txfifo(const uint8_t *buf, uint32_t w
336341
// ============================================================================
337342
// System Call Implementation for Bare-Metal ESP32-C3
338343
// ============================================================================
344+
// note(zzy): _write() implementation is inspired by ESP-IDF VFS layer:
345+
// https://github.com/espressif/esp-idf/blob/release/v6.0/components/esp_driver_usb_serial_jtag/src/usb_serial_jtag_vfs.c
339346

340347
#include <sys/types.h>
341348

0 commit comments

Comments
 (0)