charlescao460 / iSkipper-Software

A software project for iSkipper
MIT License
29 stars 2 forks source link

Printing in ISR #1

Open wizard97 opened 5 years ago

wizard97 commented 5 years ago

I quickly looked at your Arduino sketch and noticed that you are printing over Serial in your packet handlers. The packet handlers run in an ISR, and printing over Serial in an ISR is undefined behavior.

charlescao460 commented 5 years ago

Yeah actually I've found that there are some wired things happens to my Arduino Sketch when replacing answers. But it seems to be normal when capturing and sending. Anyway, I am going to refactor the entire sketch. As you might noticed, current sketch is messy and hard to modify (:зゝ∠). I'll let you know when I finish refactor. Thank you very much for this notice. I didn't know this before.

charlescao460 commented 5 years ago

I've re-written the entire sketch in #5. It should work fine.