Compare commits

...

2 Commits

Author SHA1 Message Date
nat 6ff46befb4 aimieio: exports 2024-01-10 08:08:37 -08:00
nat 99b88aef22 aimeio: less verbose, handle console created case 2024-01-10 08:08:25 -08:00
3 changed files with 18 additions and 5 deletions

View File

@ -22,11 +22,15 @@ uint16_t aime_io_get_api_version(void)
HRESULT aime_io_init(void)
{
int ret;
AllocConsole();
SetConsoleTitle("aimeio-pcsc");
FILE* fp;
freopen_s(&fp, "CONOUT$", "w", stdout);
ret = AllocConsole();
// someone might already allocated a console - seeing this on fufubot's segatools
if (ret != 0) {
// only when we allocate a console, we need to redirect stdout
freopen_s(&fp, "CONOUT$", "w", stdout);
}
ctx = aimepcsc_create();
if (!ctx) {
@ -57,7 +61,6 @@ HRESULT aime_io_nfc_poll(uint8_t unit_no)
}
memset(&data, 0, sizeof(data));
printf("aimeio-pcsc: poll.\n");
ret = aimepcsc_poll(ctx, &data);

9
aimeio/aimeio.def Normal file
View File

@ -0,0 +1,9 @@
LIBRARY aimeio
EXPORTS
aime_io_get_api_version
aime_io_init
aime_io_led_set_color
aime_io_nfc_get_aime_id
aime_io_nfc_get_felica_id
aime_io_nfc_poll

View File

@ -3,6 +3,7 @@ aimeio_lib = shared_library(
name_prefix : '',
include_directories: inc,
implicit_include_directories : false,
vs_module_defs : 'aimeio.def',
link_with: [aimepcsc_lib],
sources : [
'aimeio.c',