layer_number_util.h 643 B

1234567891011121314151617
  1. // Copyright (c) 2022 Takeshi Ishii (mtei@github)
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. #include "cpp_map.h"
  5. //build -> _<sym>,
  6. #define _BUILD_LAYER_ENUM_NUMBER(sym, str) _ ## sym,
  7. #define BUILD_LAYER_ENUM_NUMBER(ent) _BUILD_LAYER_ENUM_NUMBER ent
  8. //build -> static const char <sym>_name[] PROGMEM = str;
  9. #define _BUILD_LAYER_NAME_STR(sym, str) static const char sym ## _name[] PROGMEM = str;
  10. #define BUILD_LAYER_NAME_STR(ent) _BUILD_LAYER_NAME_STR ent
  11. //build -> [_<sym>] = <sym>_name,
  12. #define _BUILD_LAYER_NAME_TABLE(sym, str) [_##sym] = sym ## _name,
  13. #define BUILD_LAYER_NAME_TABLE(ent) _BUILD_LAYER_NAME_TABLE ent