-
-
Couldn't load subscription status.
- Fork 1k
Rebase stm32.js #2570
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
Rebase stm32.js #2570
Conversation
7d62218 to
92d4840
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good cleaning! I have not tested it, but seems good to me...
src/js/protocols/stm32.js
Outdated
| // send over the actual data | ||
| serial.send(bufferOut, function (writeInfo) {}); | ||
| serial.send(bufferOut, function (writeInfo) { | ||
| // |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at src/js/serial.js, callback seems to be optional, so we can probably just omit this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reduced.
src/js/protocols/stm32.js
Outdated
| // result = true/false | ||
| STM32_protocol.prototype.verify_flash = function (first_array, second_array) { | ||
| for (var i = 0; i < first_array.length; i++) { | ||
| for (let i = 0; i < first_array.length; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you want to fix first_array as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed
src/js/protocols/stm32.js
Outdated
| if (this.receive_buffer.length >= n_bytes) { | ||
| // data that we need are there, process immediately | ||
| var data = this.receive_buffer.slice(0, n_bytes); | ||
| const data = this.receive_buffer.slice(0, n_bytes); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you want to fix n_bytes as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed
src/js/protocols/stm32.js
Outdated
| // write start address + checksum | ||
| self.send([addressArray[0], addressArray[1], addressArray[2], addressArray[3], addressChecksum], 1, function (_reply) { | ||
| if (self.verify_response(self.status.ACK, _reply)) { | ||
| const ArrayOut = Array.from(bytesToWrite + 2); // 2 byte overhead [N, ...., checksum] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why this is capitalised?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, as original, fixed now.
11c098e
92d4840 to
11c098e
Compare
11c098e to
682539f
Compare
|
Kudos, SonarCloud Quality Gate passed!
|
|
Do I need to do anything here to get it approved? |
|
AUTOMERGE: (PASS)
|








Rebase of stm32.js:
Only one file to go (usbstm32dfu.js)