ducalex / retro-go

Retro emulation for the ODROID-GO and other ESP32 devices
GNU General Public License v2.0
543 stars 125 forks source link

Use configured tick on ESP #117

Closed tomvanbraeckel closed 3 months ago

tomvanbraeckel commented 3 months ago

The value of CONFIG_FREERTOS_HZ defaults to 100 on ESP but can be changed in the esp-idf configuration.

This minor improvement uses CONFIG_FREERTOS_HZ on ESP, instead of a hard-coded value.

ducalex commented 3 months ago

This is a good idea but instead of the #ifdef ESP_PLATFORM in the function I think we should add a retro-go constant to represent the OS' tick rate. This would allow the target to specify its own or the developer to override it at build time. Plus we might want to know the tick rate in other functions in the future.

Not sure what to call it, RG_TICK_RATE, RG_TICKRATE, RG_HZ? Or even as a time unit, RG_TICK_MS, RG_TICK_US?

ducalex commented 3 months ago

I'll just merge it now and add the constant later, no point in waiting until a constant name is decided.