File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 8
8
#include <stdlib.h>
9
9
#include <string.h>
10
10
#include <hardware/sync.h>
11
+ #if PICO_ON_DEVICE
11
12
#include "hardware/clocks.h"
13
+ #endif
12
14
#include "pico/stdlib.h"
13
15
#include "pico/test.h"
14
16
// Include sys/types.h before inttypes.h to work around issue with
@@ -342,10 +344,12 @@ static bool timer_callback_issue_2118(repeating_timer_t *rt) {
342
344
int issue_2118_test (void ) {
343
345
PICOTEST_START_SECTION ("Issue #2118 defect - failure to set an alarm" );
344
346
347
+ #if PICO_ON_DEVICE
345
348
// this problem only happens when running the clock fast as it requires the time between
346
349
// alarm_pool_irq_handler handling an alarm and setting the next alarm to be <1us
347
350
set_sys_clock_hz (200 * MHZ , true);
348
351
setup_default_uart ();
352
+ #endif
349
353
350
354
alarm_pool_t * pool = alarm_pool_create (2 , 1 );
351
355
repeating_timer_t timer ;
@@ -359,10 +363,11 @@ int issue_2118_test(void) {
359
363
PICOTEST_CHECK (counter_2118 >= 100 , "Repeating timer failure" );
360
364
361
365
alarm_pool_destroy (pool );
366
+ #if PICO_ON_DEVICE
362
367
hard_assert (timer_hw -> armed == 0 ); // check destroying the pool unarms its timer
363
-
364
368
set_sys_clock_hz (SYS_CLK_HZ , true);
365
369
setup_default_uart ();
370
+ #endif
366
371
367
372
PICOTEST_END_SECTION ();
368
373
return 0 ;
You can’t perform that action at this time.
0 commit comments