ESP32 code works only in debug mode

I have been struggling for the past few days understanding what was wrong.
Anyhow I'm working on a project that uses hall sensor, what's weird about this, is that the script use to work and that the hall sensors were working correctly.

I left the project aside for a month and when I come back it was no working anymore. I'm 100% sure that the code is right because it was working in the past and many people use the same code.

I double checked everything hardware wise, and I use vs code to upload the code into the ESP32.

Here's the weird thing, if I run the code the hall sensor don't work however if I plug the ESP32 into the computer and run it with the monitor tool of platformio.io everything works.

I'm not an expert and I can't find a solution I hope somebody here have an idea. Maybe the monitor uses a different firmware? I really need help.

And we really need to see your sketch. Please post it, using code tags when you do

And please let is know which board you did exactly select in the IDE?

Define exactly "not working".

Please read and follow the instructions in the "How to get the best out of this forum" post, linked at the head of every forum category.

When you finish reading as instructed at post #5, then we can attempt to help.

I dont have more information if I did something wrong please close the post. I don't want to be annoying

Post you code and use the <code> tags from the menu above (in the post editor).