Browse Source

Merge pull request #6666 from bgort/M100fix

Fix compiler complaint related to M100
bgort 7 years ago
parent
commit
192db2ab1b
1 changed files with 6 additions and 7 deletions
  1. 6
    7
      Marlin/M100_Free_Mem_Chk.cpp

+ 6
- 7
Marlin/M100_Free_Mem_Chk.cpp View File

153
  *  Return the number of free bytes in the memory pool,
153
  *  Return the number of free bytes in the memory pool,
154
  *  with other vital statistics defining the pool.
154
  *  with other vital statistics defining the pool.
155
  */
155
  */
156
-void free_memory_pool_report(char * const ptr, const uint16_t size) {
157
-  int16_t max_cnt = -1;
158
-  uint16_t block_cnt = 0;
156
+void free_memory_pool_report(char * const ptr, const int16_t size) {
157
+  int16_t max_cnt = -1, block_cnt = 0;
159
   char *max_addr = NULL;
158
   char *max_addr = NULL;
160
   // Find the longest block of test bytes in the buffer
159
   // Find the longest block of test bytes in the buffer
161
-  for (uint16_t i = 0; i < size; i++) {
160
+  for (int16_t i = 0; i < size; i++) {
162
     char *addr = ptr + i;
161
     char *addr = ptr + i;
163
     if (*addr == TEST_BYTE) {
162
     if (*addr == TEST_BYTE) {
164
-      const uint16_t j = count_test_bytes(addr);
163
+      const int16_t j = count_test_bytes(addr);
165
       if (j > 8) {
164
       if (j > 8) {
166
         SERIAL_ECHOPAIR("Found ", j);
165
         SERIAL_ECHOPAIR("Found ", j);
167
         SERIAL_ECHOLNPAIR(" bytes free at ", hex_address(addr));
166
         SERIAL_ECHOLNPAIR(" bytes free at ", hex_address(addr));
225
   SERIAL_ECHO(size);
224
   SERIAL_ECHO(size);
226
   SERIAL_ECHOLNPGM(" bytes of memory initialized.\n");
225
   SERIAL_ECHOLNPGM(" bytes of memory initialized.\n");
227
 
226
 
228
-  for (uint16_t i = 0; i < size; i++) {
229
-    if ((char)ptr[i] != TEST_BYTE) {
227
+  for (int16_t i = 0; i < size; i++) {
228
+    if (ptr[i] != TEST_BYTE) {
230
       SERIAL_ECHOPAIR("? address : ", hex_address(ptr + i));
229
       SERIAL_ECHOPAIR("? address : ", hex_address(ptr + i));
231
       SERIAL_ECHOLNPAIR("=", hex_byte(ptr[i]));
230
       SERIAL_ECHOLNPAIR("=", hex_byte(ptr[i]));
232
       SERIAL_EOL;
231
       SERIAL_EOL;

Loading…
Cancel
Save