Skip to content

Commit

Permalink
Update ports/esp32/mphalport.h
Browse files Browse the repository at this point in the history
Co-authored-by: Angus Gratton <[email protected]>
Signed-off-by: Andrew Leech <[email protected]>
  • Loading branch information
andrewleech and projectgus authored Sep 3, 2024
1 parent 0a8d5b9 commit 0bfd314
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ports/esp32/mphalport.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void check_esp_err_(esp_err_t code, const char *func, const int line, const char
uint32_t mp_hal_ticks_us(void);
__attribute__((always_inline)) static inline uint32_t mp_hal_ticks_cpu(void) {
uint32_t ccount;
#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6
#if CONFIG_IDF_TARGET_ARCH_RISCV
__asm__ __volatile__ ("csrr %0, 0x7E2" : "=r" (ccount)); // Machine Performance Counter Value
#else
__asm__ __volatile__ ("rsr %0,ccount" : "=a" (ccount));
Expand Down

0 comments on commit 0bfd314

Please sign in to comment.