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

Problems building on OS X #25

Open
tnlogy opened this issue Apr 21, 2022 · 2 comments
Open

Problems building on OS X #25

tnlogy opened this issue Apr 21, 2022 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@tnlogy
Copy link

tnlogy commented Apr 21, 2022

Have anyone managed to get InfiniSim running on OS X? I've made a small attempt, but haven't had much success. I did get it to show the start screen, but no events are working (maybe due to that I had to rewrite some code).

Summary of making it compile:
Change to using https://github.com/trenki2/SDL2Test/blob/master/cmake/FindSDL2.cmake to find SDL. (Installed with the downloadable dmg-file with development libraries from SDL homepage https://www.libsdl.org/download-2.0.php)

Then I had to change some code in the Alarmcontroller.cpp:
auto now = std::chrono::system_clock::now(); alarmTime = now; time_t ttAlarmTime = std::chrono::system_clock::to_time_t(now);

Then I had to remove the call:
// SDL_CreateThread(tick_thread, "tick", NULL);

And modify the while loop to force the UI to be visible:
SDL_Event e; bool quit = false; while(!quit) { SDL_PollEvent(&e); if (e.type == SDL_QUIT){ quit = true; } // SDL_Delay(LV_DISP_DEF_REFR_PERIOD); // lv_tick_inc(LV_DISP_DEF_REFR_PERIOD); // Crashed when called here or in tick_thread. fw.handle_keys(); // key event polling fw.handle_touch_and_button(); fw.refresh(); usleep(LV_DISP_DEF_REFR_PERIOD * 1000); }

If I run it with unmodified code it crashes with: Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'nextEventMatchingMask should only be called from the Main Thread!'

Maybe this can be of help if someone else tries to make it work on a Mac?

@NeroBurner NeroBurner added enhancement New feature or request help wanted Extra attention is needed labels Apr 24, 2022
@adrienluitot
Copy link

I couldn't build on Mac OS Ventura (M2 Apple silicon) neither.

I had the error :

DateTimeController.cpp:72:66: error: no viable conversion from 'time_point<[...], duration<[...], ratio<[...], 1000000000>>>' to 'const time_point<[...], duration<[...], ratio<[...], 1000000>>>'
  std::time_t currentTime = std::chrono::system_clock::to_time_t(currentDateTime);

Thus, I made a change on DateTimeController.cpp on line 72.
I added a cast like this :

std::time_t currentTime = std::chrono::system_clock::to_time_t(
    std::chrono::time_point_cast<std::chrono::system_clock::duration>(currentDateTime)
);

Then, to be able to run the simulation, I also did the changes to main.cpp (As tnlogy said above) to fix this error :
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'nextEventMatchingMask should only be called from the Main Thread!'

But I pretty sure we can find a better fix.

PS: I haven't investigate yet and I don't know what is the given infinitime firmware, but nothing seems to work. I can't quit (without a kill), can't touch anything...

@ianmlunaq

This comment was marked as duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants