forked from TeamTofuShop/segatools
chuniio: use HRESULT instead of int for chuni_io_led_init()
This commit is contained in:
@ -166,7 +166,7 @@ static unsigned int __stdcall chuni_io_slider_thread_proc(void *ctx)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int chuni_io_led_init()
|
||||
HRESULT chuni_io_led_init(void)
|
||||
{
|
||||
return led_output_init(&chuni_io_cfg);
|
||||
}
|
||||
|
@ -153,7 +153,7 @@ void chuni_io_slider_set_leds(const uint8_t *rgb);
|
||||
overlap with each other. Ensuring synchronization inside your IO DLL is
|
||||
your responsibility. */
|
||||
|
||||
int chuni_io_led_init();
|
||||
HRESULT chuni_io_led_init(void);
|
||||
|
||||
/* Update the RGB LEDs. rgb is a pointer to an array of 66 * 3 = 198
|
||||
bytes. The majority of these are for the marquee display, but the final
|
||||
|
@ -19,18 +19,18 @@ static bool any_outputs_enabled;
|
||||
|
||||
HANDLE led_init_mutex;
|
||||
|
||||
int led_output_init(struct chuni_io_config* const cfg)
|
||||
HRESULT led_output_init(struct chuni_io_config* const cfg)
|
||||
{
|
||||
DWORD dwWaitResult = WaitForSingleObject(led_init_mutex, INFINITE);
|
||||
if (dwWaitResult == WAIT_FAILED)
|
||||
{
|
||||
// return HRESULT_FROM_WIN32(GetLastError());
|
||||
return 1;
|
||||
return HRESULT_FROM_WIN32(GetLastError());
|
||||
// return 1;
|
||||
}
|
||||
else if (dwWaitResult != WAIT_OBJECT_0)
|
||||
{
|
||||
// return E_FAIL;
|
||||
return 1;
|
||||
return E_FAIL;
|
||||
// return 1;
|
||||
}
|
||||
|
||||
if (!led_output_is_init)
|
||||
@ -65,8 +65,8 @@ int led_output_init(struct chuni_io_config* const cfg)
|
||||
led_output_is_init = true;
|
||||
|
||||
ReleaseMutex(led_init_mutex);
|
||||
// return S_OK;
|
||||
return 0;
|
||||
return S_OK;
|
||||
// return 0;
|
||||
}
|
||||
|
||||
struct _chuni_led_data_buf_t* escape_led_data(struct _chuni_led_data_buf_t* unescaped)
|
||||
|
@ -15,5 +15,5 @@
|
||||
#include "chuniio/config.h"
|
||||
|
||||
extern HANDLE led_init_mutex;
|
||||
int led_output_init(struct chuni_io_config* const cfg);
|
||||
HRESULT led_output_init(struct chuni_io_config* const cfg);
|
||||
void led_output_update(uint8_t board, const byte* rgb);
|
||||
|
Reference in New Issue
Block a user