File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed
lib/pbio/platform/sim_hub Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change 99#include "py/runtime.h"
1010#include "py/mphal.h"
1111
12+ #if PBDRV_CONFIG_CLOCK_TEST
13+ #include <pbdrv/../../drv/clock/clock_test.h>
14+ #endif
15+
1216pbio_os_irq_flags_t pbio_os_hook_disable_irq (void ) {
1317 sigset_t sigmask ;
14- sigfillset (& sigmask );
1518
19+ #if PBDRV_CONFIG_CLOCK_TEST
20+ sigemptyset (& sigmask );
21+ return sigmask ;
22+ #endif
23+
24+ sigfillset (& sigmask );
1625 sigset_t origmask ;
1726 pthread_sigmask (SIG_SETMASK , & sigmask , & origmask );
1827 return origmask ;
1928}
2029
2130void pbio_os_hook_enable_irq (pbio_os_irq_flags_t flags ) {
31+ #if PBDRV_CONFIG_CLOCK_TEST
32+ return ;
33+ #endif
34+
2235 sigset_t origmask = (sigset_t )flags ;
2336 pthread_sigmask (SIG_SETMASK , & origmask , NULL );
2437}
2538
2639void pbio_os_hook_wait_for_interrupt (pbio_os_irq_flags_t flags ) {
40+ #if PBDRV_CONFIG_CLOCK_TEST
41+ // All events have been handled at this time. Advance the clock
42+ // and continue immediately.
43+ pbio_test_clock_tick (1 );
44+ return ;
45+ #endif
46+
2747 struct timespec timeout = {
2848 .tv_sec = 0 ,
2949 .tv_nsec = 100000 ,
Original file line number Diff line number Diff line change 1515#define PBDRV_CONFIG_BUTTON_TEST (1)
1616
1717#define PBDRV_CONFIG_CLOCK (1)
18- #define PBDRV_CONFIG_CLOCK_LINUX (1)
18+ #ifdef PBDRV_CONFIG_CLOCK_LINUX
1919#define PBDRV_CONFIG_CLOCK_LINUX_SIGNAL (1)
20+ #else
21+ #define PBDRV_CONFIG_CLOCK_TEST (1)
22+ #endif
2023
2124#define PBDRV_CONFIG_COUNTER (1)
2225
You can’t perform that action at this time.
0 commit comments