diff --git a/radio/src/storage/conversions/yaml/bitfield.h b/radio/src/storage/conversions/yaml/bitfield.h deleted file mode 100644 index a0c753e0f..000000000 --- a/radio/src/storage/conversions/yaml/bitfield.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (C) OpenTX - * - * Based on code named - * th9x - http://code.google.com/p/th9x - * er9x - http://code.google.com/p/er9x - * gruvin9x - http://code.google.com/p/gruvin9x - * - * This file is based on work published at http://www.coranac.com/documents/working-with-bits-and-bitfields - * - * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#ifndef BITFIELD_H -#define BITFIELD_H - -#include - -// A set of bitfield handling macros - -template -inline T bfBit(uint8_t n) -{ - return T(1) << n; -} - -#define BFBIT_SET(y, mask) ( y |= (mask) ) -#define BFBIT_CLEAR(y, mask) ( y &= ~(mask) ) -#define BFBIT_FLIP(y, mask) ( y ^= (mask) ) -#define BF_SINGLE_BIT_SET(y, i) BFBIT_SET(y, bfBit(i)) - -//! Create a bitmask of length 'len'. -template -inline T bfBitmask(uint8_t len) -{ - return bfBit(len) - 1; -} - -//! Create a bitfield mask of length 'len' starting at bit 'start'. -template -inline T bfMask(uint8_t start, uint8_t len) -{ - return bfBitmask(len) << start; -} - -//! Prepare a bitmask for insertion or combining. -template -inline T bfPrep(T x, uint8_t start, uint8_t len) -{ - return (x & bfBitmask(len)) << start; -} - -//! Extract a bitfield of length 'len' starting at bit 'start' from 'y'. -template -inline T bfGet(T y, uint8_t start, uint8_t len) -{ - return ((y)>>(start)) & bfBitmask(len); -} - -//! Insert 'len' bits of 'x 'into 'y', starting at bit 'start' from 'y'. -template -inline T bfSet(T to, T from, uint8_t start, uint8_t len) -{ - return (to & ~bfMask(start, len)) | bfPrep(from, start, len); -} - -template -inline T bfBitGet(T y, T mask) -{ - return (y & mask); -} - -template -inline T bfSingleBitGet(T y, uint8_t i) -{ - return bfBitGet(y, bfBit(i)); -} - -#endif //BITFIELD_H diff --git a/radio/src/storage/conversions/yaml/yaml_datastructs_funcs.cpp b/radio/src/storage/conversions/yaml/yaml_datastructs_funcs.cpp index c2117cf67..537a1a625 100644 --- a/radio/src/storage/conversions/yaml/yaml_datastructs_funcs.cpp +++ b/radio/src/storage/conversions/yaml/yaml_datastructs_funcs.cpp @@ -22,7 +22,6 @@ #include #include -//#include "bitfield.h" #include "dataconstants_220.h" #include "datastructs_220.h" #include "myeeprom_220.h" diff --git a/radio/src/storage/conversions/yaml/zone_220.h b/radio/src/storage/conversions/yaml/zone_220.h index 5e9471bbb..3c80bcfed 100644 --- a/radio/src/storage/conversions/yaml/zone_220.h +++ b/radio/src/storage/conversions/yaml/zone_220.h @@ -62,5 +62,5 @@ struct ZoneOption struct ZoneOptionValueTyped { ZoneOptionValueEnum type; - ZoneOptionValue value FUNC(select_zov); + ZoneOptionValue value; }; diff --git a/radio/src/storage/yaml/yaml_datastructs.cpp b/radio/src/storage/yaml/yaml_datastructs.cpp index 2d4f6ca6c..1fdca7f0d 100644 --- a/radio/src/storage/yaml/yaml_datastructs.cpp +++ b/radio/src/storage/yaml/yaml_datastructs.cpp @@ -61,4 +61,5 @@ #error "Board not supported by YAML storage" #endif -static_assert(MAX_STR > MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN); +static_assert(MAX_STR > MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN, + "MAX_STR > MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN");