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

Added bit banged serial #3

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

9903286
Copy link

@9903286 9903286 commented May 31, 2018

I've attempted to implement softwareserial into pigpioj and it seems i was successful, please check my code and see if i did anything weird considering this is my first time with JNI, C, makefiles and such.

From what i can see everything is working as intended, so i've also added a class called "PigpioTestBBSerial.java" in "uk.pigpioj.test" that gave me this output when i ran it:
https://pastebin.com/yk1fTkrS

(Simple to try yourself: Just change the pins in the java class and connect them together, then run the main function)

@mattjlewis
Copy link
Owner

Excellent, I'll take a look this weekend!

@9903286
Copy link
Author

9903286 commented Jun 1, 2018

After running it for a while, i got
java: malloc.c:2406: sysmalloc: Assertion (old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0) failed.
Not sure what this means, but it seems to maybe be a memory leak caused by char *buf = (char*) malloc(maxSize); on line 34 in uk_pigpioj_PigpioBitBangSerial.c, not sure how to fix this.

@9903286
Copy link
Author

9903286 commented Jun 1, 2018

Added the free() function to my malloc variable, seems to be working now, gonna run it for a while more tough.
EDIT: Been running it for 2+ hours now, seems to be fixed.

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

Successfully merging this pull request may close these issues.

None yet

2 participants