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

Allocated memory for the PFS buffer dynamically. Saves 60 bytes. #394

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

Conversation

microbit-sam
Copy link
Contributor

Please don't merge yet - still need to completely test Partial Flashing


This PR only allocates the large buffer used in partial flashing when it's required

@finneyj
Copy link
Contributor

finneyj commented Oct 5, 2018

thanks @microbit-sam. Do you think this is ready to go, or does it need more testing?

@microbit-sam
Copy link
Contributor Author

I need to test partial flashing still works, running a local instance of MakeCode has changed since I last did it so haven't had time to get it going again

I'll add testing to my Monday todo list

@finneyj
Copy link
Contributor

finneyj commented Oct 5, 2018

ACK - thanks.

@pelikhan
Copy link

pelikhan commented Oct 5, 2018 via email

@pelikhan pelikhan requested a review from finneyj October 8, 2018 04:10
@microbit-sam
Copy link
Contributor Author

Sorry for the delay this week, been testing this afternoon and it's not resetting after flashing. Will update ASAP

@@ -200,6 +200,11 @@ void MicroBitPartialFlashingService::flashData(uint8_t *data)

packetCount++;

// Reallocate block
if(block == NULL) {
(uint32_t*) malloc(16 * sizeof(uint32_t));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be block = .... ???

@@ -200,6 +200,11 @@ void MicroBitPartialFlashingService::flashData(uint8_t *data)

packetCount++;

// Reallocate block
if(block == NULL) {
(uint32_t*) malloc(16 * sizeof(uint32_t));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(uint32_t*) malloc(16 * sizeof(uint32_t));
block = (uint32_t*) malloc(16 * sizeof(uint32_t));

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

Successfully merging this pull request may close these issues.

4 participants