|
| 1 | +/* |
| 2 | + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD |
| 3 | + * |
| 4 | + * SPDX-License-Identifier: Apache-2.0 |
| 5 | + */ |
| 6 | +#pragma once |
| 7 | + |
| 8 | +#include "ESP_Panel_Conf_Internal.h" |
| 9 | +#include "ESP_Panel_Board_Internal.h" |
| 10 | + |
| 11 | +/* Library Version */ |
| 12 | +#define ESP_PANEL_VERSION_MAJOR 0 |
| 13 | +#define ESP_PANEL_VERSION_MINOR 1 |
| 14 | +#define ESP_PANEL_VERSION_PATCH 3 |
| 15 | + |
| 16 | +/* File `ESP_Panel_Conf.h` */ |
| 17 | +#define ESP_PANEL_CONF_VERSION_MAJOR 1 |
| 18 | +#define ESP_PANEL_CONF_VERSION_MINOR 1 |
| 19 | +#define ESP_PANEL_CONF_VERSION_PATCH 0 |
| 20 | + |
| 21 | +/* File `ESP_Panel_Board_Custom.h` */ |
| 22 | +#define ESP_PANEL_BOARD_CUSTOM_VERSION_MAJOR 1 |
| 23 | +#define ESP_PANEL_BOARD_CUSTOM_VERSION_MINOR 1 |
| 24 | +#define ESP_PANEL_BOARD_CUSTOM_VERSION_PATCH 0 |
| 25 | + |
| 26 | +/* File `ESP_Panel_Board_Supported.h` */ |
| 27 | +#define ESP_PANEL_BOARD_SUPPORTED_VERSION_MAJOR 1 |
| 28 | +#define ESP_PANEL_BOARD_SUPPORTED_VERSION_MINOR 1 |
| 29 | +#define ESP_PANEL_BOARD_SUPPORTED_VERSION_PATCH 0 |
| 30 | + |
| 31 | +/* Check if the current configuration file version is compatible with the library version */ |
| 32 | +// File `ESP_Panel_Conf.h` |
| 33 | +// If the version is not defined, set it to `1.0.0` |
| 34 | +#if !defined(ESP_PANEL_CONF_FILE_VERSION_MAJOR) && \ |
| 35 | + !defined(ESP_PANEL_CONF_FILE_VERSION_MINOR) && \ |
| 36 | + !defined(ESP_PANEL_CONF_FILE_VERSION_PATCH) |
| 37 | +#define ESP_PANEL_CONF_FILE_VERSION_MAJOR 1 |
| 38 | +#define ESP_PANEL_CONF_FILE_VERSION_MINOR 0 |
| 39 | +#define ESP_PANEL_CONF_FILE_VERSION_PATCH 0 |
| 40 | +#endif |
| 41 | +// Check if the current configuration file version is compatible with the library version |
| 42 | +#if ESP_PANEL_CONF_FILE_VERSION_MAJOR != ESP_PANEL_CONF_VERSION_MAJOR |
| 43 | +#error "The file `ESP_Panel_Conf.h` version is not compatible. Please update it with the file from the library" |
| 44 | +#elif ESP_PANEL_CONF_FILE_VERSION_MINOR < ESP_PANEL_CONF_VERSION_MINOR |
| 45 | +#warning "The file `ESP_Panel_Conf.h` version is outdated. Some new configurations might be missing" |
| 46 | +#endif /* ESP_PANEL_CONF_INCLUDE_INSIDE */ |
| 47 | + |
| 48 | +// File `ESP_Panel_Board_Custom.h` & `ESP_Panel_Board_Supported.h` |
| 49 | +#ifdef ESP_PANEL_USE_BOARD |
| 50 | +/* For using a supported board */ |
| 51 | +#if CONFIG_ESP_PANEL_USE_SUPPORTED_BOARD || ESP_PANEL_USE_SUPPORTED_BOARD |
| 52 | +// If the version is not defined, set it to `1.0.0` |
| 53 | +#if !defined(ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MAJOR) && \ |
| 54 | + !defined(ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR) && \ |
| 55 | + !defined(ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_PATCH) |
| 56 | +#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MAJOR 1 |
| 57 | +#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR 0 |
| 58 | +#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_PATCH 0 |
| 59 | +#endif |
| 60 | +// Check if the current configuration file version is compatible with the library version |
| 61 | +#if ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MAJOR != ESP_PANEL_BOARD_SUPPORTED_VERSION_MAJOR |
| 62 | +#error "The file `ESP_Panel_Board_Supported.h` version is not compatible. Please update it with the file from the library" |
| 63 | +#elif ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR < ESP_PANEL_BOARD_SUPPORTED_VERSION_MINOR |
| 64 | +#warning "The file `ESP_Panel_Board_Supported.h` version is outdated. Some new configurations might be missing" |
| 65 | +#endif |
| 66 | + |
| 67 | +#else /* For using a custom board */ |
| 68 | + |
| 69 | +// If the version is not defined, set it to `1.0.0` |
| 70 | +#if !defined(ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR) && \ |
| 71 | + !defined(ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR) && \ |
| 72 | + !defined(ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH) |
| 73 | +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 1 |
| 74 | +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 0 |
| 75 | +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0 |
| 76 | +#endif |
| 77 | +// Check if the current configuration file version is compatible with the library version |
| 78 | +#if ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR != ESP_PANEL_BOARD_CUSTOM_VERSION_MAJOR |
| 79 | +#error "The file `ESP_Panel_Board_Custom.h` version is not compatible. Please update it with the file from the library" |
| 80 | +#elif ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR < ESP_PANEL_BOARD_CUSTOM_VERSION_MINOR |
| 81 | +#warning "The file `ESP_Panel_Board_Custom.h` version is outdated. Some new configurations might be missing" |
| 82 | +#endif |
| 83 | +#endif /* CONFIG_ESP_PANEL_USE_SUPPORTED_BOARD || ESP_PANEL_USE_SUPPORTED_BOARD */ |
| 84 | +#endif /* ESP_PANEL_USE_BOARD */ |
0 commit comments