lzrtag / LZRTag

AVR-Based easily modifyable DIY Lasertag!
GNU General Public License v3.0
94 stars 11 forks source link

Implementing, connecting & configuring the ESP! #8

Closed Xasin closed 7 years ago

Xasin commented 7 years ago

This PR contains pretty much all necessary code to properly communicate between the ESP and AVR ESP->AVR is tested, AVR->ESP still needs the receiving code, but that should be fairly easy :3

Also contained is the schematics change to the Lasertag set required to use the UART, as well as necessary pin changes etc.

I /should/ have put the Fresh_IR PR to main, but ... It's in here now, so whatevers :S


This change is Reviewable

Xasin commented 7 years ago

Reviewed 2 of 8 files at r1, 3 of 5 files at r2, 40 of 40 files at r3. Review status: all files reviewed at latest revision, 3 unresolved discussions.


EclipseWS/MainBoard/Localcode/ESPComs/ESPUART.cpp, line 49 at r3 (raw file):

          }
          RXEndpoint = RXEndpoint->nextEndpoint;
          if(RXEndpoint == 0)

That needs to be moved upwards, else having no Endpoints might crash. Silly, yes, but a potential problem.


EclipseWS/MainBoard/Localcode/IRComs/IR_RX.cpp, line 55 at r3 (raw file):

  if(tempOCR1B >= FRAME_TICKS)
      tempOCR1B -= FRAME_TICKS;
  OCR1B = tempOCR1B;

Flip these around >.> If not, there is a brief window for OCR1B to generate a match interrupt before the new value is set. Rare, but hey, can happen.


EclipseWS/MainBoard/Localcode/IRComs/IR_RX.cpp, line 89 at r3 (raw file):


          if(RXCallback != 0)
              RXCallback(*(ShotPacket *)&data);

Callback needs to be called AFTER the checksum has been confirmed! Yikes :S


Comments from Reviewable

Xasin commented 7 years ago

Reviewed 2 of 2 files at r4. Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable