Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with timeSetEvent using win32 port #430

Open
Francis900 opened this issue Jan 10, 2025 · 0 comments
Open

Problem with timeSetEvent using win32 port #430

Francis900 opened this issue Jan 10, 2025 · 0 comments
Labels
bug Something isn't working hardware New hardware or architecture support request

Comments

@Francis900
Copy link

I’m encountering two issues while trying to compile a project that contains ThreadX (master branch) in a Win32 port using Visual Studio Code on Windows 10:

Pointer type mismatch with timeSetEvent:
There’s an incompatible pointer type error when passing the third argument to timeSetEvent. The error message is:

Passing argument 3 of 'timeSetEvent' from incompatible pointer type [-Wincompatible-pointer-types].
It seems there’s an issue with the type of the third argument being passed to timeSetEvent.

Warning about #pragma comment:
I’m getting a warning:
#pragma comment: ignoring '#pragma comment' [-Wunknown-pragmas].
The line in question is:
#pragma comment (lib, "Winmm.lib").
This seems to be related to linking the Winmm.lib library, but even after manually adding the library paths to the compiler, it still can't find winmm.lib. I’m unsure why the pragma is being ignored.

I’m using the latest master branch of ThreadX, and I’m working in a Win32 environment with Visual Studio Code with gcc.

Any help with resolving these issues would be greatly appreciated.

\threadx\ports\win32\vs_2019\src\tx_initialize_low_level.c: In function '_tx_initialize_start_interrupts':
C:...\threadx\ports\win32\vs_2019\src\tx_initialize_low_level.c:272:69: error: passing argument 3 of 'timeSetEvent' from incompatible pointer type [-Wincompatible-pointer-types]
  272 |     _tx_win32_timer_id = timeSetEvent(TX_TIMER_PERIODIC, wTimerRes, _tx_win32_timer_interrupt, 0, TIME_PERIODIC);
      |                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                                     |
      |                                                                     void (*)(UINT,  UINT,  DWORD,  DWORD,  DWORD) {aka void (*)(unsigned int,  unsigned int,  long unsigned int,  long unsigned int,  long unsigned int)}
In file included from C:/msys64/mingw64/include/mmsystem.h:27,
                 from C:/msys64/mingw64/include/windows.h:86,
                 from C:.../threadx/ports/win32/vs_2019/inc/tx_port.h:162,
                 from C:.../threadx/common/inc/tx_api.h:133,
                 from C:...\threadx\ports\win32\vs_2019\src\tx_initialize_low_level.c:28:
C:/msys64/mingw64/include/mmiscapi2.h:32:85: note: expected 'LPTIMECALLBACK' {aka 'void (*)(unsigned int,  unsigned int,  long long unsigned int,  long long unsigned int,  long long unsigned int)'} but argument is of type 'void (*)(UINT,  UINT,  DWORD,  DWORD,  DWORD)' {aka 'void (*)(unsigned int,  unsigned int,  long unsigned int,  long unsigned int,  long unsigned int)'}
   32 | WINMMAPI MMRESULT WINAPI timeSetEvent(UINT uDelay, UINT uResolution, LPTIMECALLBACK fptc, DWORD_PTR dwUser, UINT fuEvent);
      |                                                                      ~~~~~~~~~~~~~~~^~~~

@Francis900 Francis900 added bug Something isn't working hardware New hardware or architecture support request labels Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hardware New hardware or architecture support request
Projects
None yet
Development

No branches or pull requests

1 participant