|
| 1 | +/** |
| 2 | + * @file gd32xxxx.h |
| 3 | + * |
| 4 | + */ |
| 5 | +/* Copyright (C) 2026 by Arjan van Vught mailto:info@gd32-dmx.org |
| 6 | + * |
| 7 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 8 | + * of this software and associated documentation files (the "Software"), to deal |
| 9 | + * in the Software without restriction, including without limitation the rights |
| 10 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 11 | + * copies of the Software, and to permit persons to whom the Software is |
| 12 | + * furnished to do so, subject to the following conditions: |
| 13 | +
|
| 14 | + * The above copyright notice and this permission notice shall be included in |
| 15 | + * all copies or substantial portions of the Software. |
| 16 | +
|
| 17 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 18 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 19 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 20 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 21 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 22 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 23 | + * THE SOFTWARE. |
| 24 | + */ |
| 25 | + |
| 26 | +#ifndef GD32FXXX_H_ |
| 27 | +#define GD32FXXX_H_ |
| 28 | + |
| 29 | +// Needed for GD32 Firmware and CMSIS |
| 30 | + |
| 31 | +#ifdef __cplusplus |
| 32 | +#pragma GCC diagnostic push |
| 33 | +#pragma GCC diagnostic ignored "-Wuseless-cast" |
| 34 | +#pragma GCC diagnostic ignored "-Wold-style-cast" |
| 35 | +#pragma GCC diagnostic ignored "-Wconversion" |
| 36 | +#pragma GCC diagnostic ignored "-Wsign-conversion" |
| 37 | +#if __cplusplus > 201402 |
| 38 | +// error: compound assignment with 'volatile'-qualified left operand is |
| 39 | +// deprecated |
| 40 | +#pragma GCC diagnostic ignored "-Wvolatile" |
| 41 | +#endif |
| 42 | +#endif |
| 43 | + |
| 44 | +#if defined(GD32F10X_HD) || defined(GD32F10X_CL) |
| 45 | +#include "gd32f10x.h" // IWYU pragma: keep |
| 46 | +#elif defined(GD32F20X_CL) |
| 47 | +#include "gd32f20x.h" // IWYU pragma: keep |
| 48 | +#elif defined(GD32F30X_HD) |
| 49 | +#include "gd32f30x.h" // IWYU pragma: keep |
| 50 | +#elif defined(GD32F407) || defined(GD32F450) || defined(GD32F470) |
| 51 | +#include "gd32f4xx.h" // IWYU pragma: keep |
| 52 | +#elif defined(GD32H757) || defined(GD32H759) |
| 53 | +#include "gd32h7xx.h" // IWYU pragma: keep |
| 54 | +#else |
| 55 | +#error MCU is not supported |
| 56 | +#endif |
| 57 | + |
| 58 | +#ifdef __cplusplus |
| 59 | +#pragma GCC diagnostic pop |
| 60 | +#endif |
| 61 | + |
| 62 | +#endif // GD32FXXX_H_ */ |
0 commit comments