Improve JVS bus life cycle handling

This commit is contained in:
Tau
2019-11-03 13:01:03 -05:00
parent 93fcdf8f6d
commit 0e1cfb66db
24 changed files with 164 additions and 65 deletions

View File

@ -18,7 +18,7 @@ static uint8_t chuni_io_hand_pos;
static HANDLE chuni_io_slider_thread;
static bool chuni_io_slider_stop_flag;
HRESULT chuni_io_init(void)
HRESULT chuni_io_jvs_init(void)
{
return S_OK;
}
@ -73,6 +73,11 @@ void chuni_io_jvs_poll(uint8_t *opbtn, uint8_t *beams)
void chuni_io_jvs_set_coin_blocker(bool open)
{}
HRESULT chuni_io_slider_init(void)
{
return S_OK;
}
void chuni_io_slider_start(chuni_io_slider_callback_t callback)
{
if (chuni_io_slider_thread != NULL) {

View File

@ -1,10 +1,11 @@
LIBRARY chuniio
EXPORTS
chuni_io_init
chuni_io_jvs_init
chuni_io_jvs_poll
chuni_io_jvs_read_coin_counter
chuni_io_jvs_set_coin_blocker
chuni_io_slider_init
chuni_io_slider_set_leds
chuni_io_slider_start
chuni_io_slider_stop

View File

@ -5,15 +5,15 @@
#include <stdbool.h>
#include <stdint.h>
/* Initialize the Chunithm IO provider DLL. This is the first function to be
called on this DLL. Returning failure from this function will cause the
main application to immediately exit.
/* Initialize JVS-based input. This function will be called before any other
chuni_io_jvs_*() function calls. Errors returned from this function will
manifest as a disconnected JVS bus.
All subsequent calls may originate from arbitrary threads and some may
overlap with each other. Ensuring synchronization inside your IO DLL is
your responsibility. */
HRESULT chuni_io_init(void);
HRESULT chuni_io_jvs_init(void);
/* Poll JVS input.
@ -44,6 +44,15 @@ void chuni_io_jvs_read_coin_counter(uint16_t *total);
void chuni_io_jvs_set_coin_blocker(bool open);
/* Initialize touch slider emulation. This function will be called before any
other chuni_io_slider_*() function calls.
All subsequent calls may originate from arbitrary threads and some may
overlap with each other. Ensuring synchronization inside your IO DLL is
your responsibility. */
HRESULT chuni_io_slider_init(void);
/* Chunithm touch slider layout:
^^^ Toward screen ^^^