Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: LambdaController.cpp
- Revision:
- 2:82c94d2c727a
- Parent:
- 1:e270b8b60070
- Child:
- 3:9f80eee7aa78
--- a/LambdaController.cpp Tue Aug 23 05:17:15 2016 +0000 +++ b/LambdaController.cpp Tue Aug 23 05:30:07 2016 +0000 @@ -28,7 +28,15 @@ if(data == EOF){ buffer_head = -1; error_id = InvalidDataError; - } + } + + if (buffer_head < 10 && buffer_head != -1) { + received_buffer[buffer_head] = data; + buffer_head++; + } else { + error_id = InvalidDataError; + buffer_head = -1; + } if (buffer_head == 10 && received_buffer[0] == 0x3A) { for (i = 0; i < 10; i++) { @@ -37,6 +45,7 @@ if (!is_axis_initialized) { initialize_axis(); + is_axis_initialized = true; } error_count = 0;