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

Version for use with PIC #19

Closed
Doubletop12 opened this issue Jul 9, 2020 · 1 comment
Closed

Version for use with PIC #19

Doubletop12 opened this issue Jul 9, 2020 · 1 comment

Comments

@Doubletop12
Copy link

I've been asked by Chris to document the variant I am using with a PIC. It is in 'C' with the XC8 complier under the MPLAB IDE.
I'm not an expert by any means but the changes are fairly minor and they work. This may even be the wrong place to post this.

Steps are:

Rename DYPlayer.cpp DyPlayer.c

Remove all class statements e.g “DYPlayer::” from all functions

Remove all “inline” statements from functions

Include relevant headers

  • #include "mcc_generated_files/uart2.h"
  • #include <xc.h>
  • #include <stdlib.h>
  • #include <stdbool.h>

Add serial read and write functions, including a separate function for the single byte crc serialwrite_crc. Using a buffer length of [1] didn’t work so this was the quick fix. Serial read write functions are as generated by MPLAB Code Configurator (MPP).

  • uint8_t UARTx_Read(void)
  • void UARTx_Write(uint8_t txData)

Amend DYPlayer.h to match DYPlayer.c

Modify typedef and enum statements to be XC8 compliant.

Files attached

DYPlayer for PIC.zip

Pete

@SnijderC
Copy link
Owner

Added this to the README for future reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants