Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5020

SDK • Trouble printing time_us_64()

$
0
0
Hi,

I need to print the result of time_us_64(). I tried using %d and produces 0 (clearly wrong). I then tried %ll and %ull and in both cases is simply got nothing in the output after the string constant.

Code:

    if (gpio_get_irq_event_mask(USR_BTN) & level_change) {      unsigned long long ltmp=time_us_64() ;      printf("### enter debounce %d \n",ltmp);  

Code:

### Exit setup0() ###                                                           ### enter debounce 0                                                            ### enter debounce 0         


This is right after boot so even with shorter formats the number should not be too big.

This is running on core1, is the system tick counter available to both cores? If not, is there a way ? I'm trying to debounce a button press and need to ensure a minimum time lapse to avoid glitches.

TIA.

Statistics: Posted by pie_face — Mon Dec 30, 2024 7:56 pm



Viewing all articles
Browse latest Browse all 5020

Trending Articles