Adapt G26 to work for all meshes

This commit is contained in:
Scott Lahteine
2017-11-23 17:59:43 -06:00
parent 5ce7f23afa
commit c6b0c104bb
20 changed files with 661 additions and 727 deletions

View File

@ -95,6 +95,9 @@
#define STRINGIFY(M) STRINGIFY_(M)
// Macros for bit masks
#ifndef _BV
#define _BV(B) (1UL<<(B))
#endif
#define TEST(n,b) (((n)&_BV(b))!=0)
#define SBI(n,b) (n |= _BV(b))
#define CBI(n,b) (n &= ~_BV(b))

View File

@ -23,7 +23,7 @@
#ifndef __UTILITY_H__
#define __UTILITY_H__
#include "../inc/MarlinConfig.h"
#include "../inc/MarlinConfigPre.h"
constexpr char axis_codes[XYZE] = { 'X', 'Y', 'Z', 'E' };
@ -33,6 +33,18 @@ void safe_delay(millis_t ms);
void crc16(uint16_t *crc, const void * const data, uint16_t cnt);
#endif
#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION)
/**
* These support functions allow the use of large bit arrays of flags that take very
* little RAM. Currently they are limited to being 16x16 in size. Changing the declaration
* to unsigned long will allow us to go to 32x32 if higher resolution Mesh's are needed
* in the future.
*/
FORCE_INLINE void bit_clear(uint16_t bits[16], const uint8_t x, const uint8_t y) { CBI(bits[y], x); }
FORCE_INLINE void bit_set(uint16_t bits[16], const uint8_t x, const uint8_t y) { SBI(bits[y], x); }
FORCE_INLINE bool is_bit_set(uint16_t bits[16], const uint8_t x, const uint8_t y) { return TEST(bits[y], x); }
#endif
#if ENABLED(ULTRA_LCD)
// Convert uint8_t to string with 123 format