libmsx
C library for MSX
Loading...
Searching...
No Matches
Await interrupts

Await interrupts. More...

+ Collaboration diagram for Await interrupts:

Macros

#define await_interrupt()
 MSX Waits for next interrupt.
 

Functions

void await_vsync (void)
 MSX Waits for next VSYNC interrupt.
 

Variables

volatile bool vsync_busy
 MSX "Busy" flag for VSYNC interrupt routine.
 

Detailed Description

Await interrupts.

Macro Definition Documentation

◆ await_interrupt

#define await_interrupt ( )
Value:
__asm__("ei"); \
__asm__("halt")

MSX Waits for next interrupt.

Calling to await_interrupt() waits for next interrupt and blocks until the interrupt would to be processed.

Note
This waits for any type of interrupt including VSYNC. If you want to wait for VSYNC, use await_vsync() instead.
This function is supposed to be used to synchronize with an interrupt in the main loop of the application.
This function cannot be used from an interrupt handler; if you need an interrupt handler for any type of interrupt, use set_interrupt_handler() instead. Or if you need an interrupt handler for VSYNC, use set_vsync_handler().
See also
await_vsync()

Definition at line 71 of file interrupt.h.

Function Documentation

◆ await_vsync()

void await_vsync ( void  )

MSX Waits for next VSYNC interrupt.

Calling to await_vsync() waits for next VSYNC interrupt and blocks until the interrupt would to be processed.

Note
This function is supposed to be used to synchronize with VSYNC in the main loop of the application.
This function cannot be used from an interrupt handler; if you need an interrupt handler for VSYNC, use set_vsync_handler() instead.
See also
await_interrupt()

Variable Documentation

◆ vsync_busy

volatile bool vsync_busy
extern

MSX "Busy" flag for VSYNC interrupt routine.

vsync_busy is set to false when the VSYNC interrupt routine finished.

Note
This is used internally by await_vsync() to work with the VSYNC interrupt routine. Normally, you don't need to worry about this. However, if you want to override the default VSYNC interrupt routine without using set_vsync_handler(), you have to clear it in the VSYNC interrupt routine.