refactor: move CHERRYUSB_VERSION and CHERRYUSB_VERSION_STR into usb_version.h

This commit is contained in:
sakumisu 2024-08-16 14:16:45 +08:00
parent b171b28a75
commit 143a5ce3fd
10 changed files with 23 additions and 21 deletions

View File

@ -6,9 +6,6 @@
#ifndef CHERRYUSB_CONFIG_H
#define CHERRYUSB_CONFIG_H
#define CHERRYUSB_VERSION 0x010301
#define CHERRYUSB_VERSION_STR "v1.3.1"
/* ================ USB common Configuration ================ */
#define CONFIG_USB_PRINTF(...) printf(__VA_ARGS__)

21
common/usb_version.h Normal file
View File

@ -0,0 +1,21 @@
/*
* Copyright (c) 2024, sakumisu
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef USB_VERSION_H
#define USB_VERSION_H
#ifdef CHERRYUSB_VERSION
#warning "Please do not define CHERRYUSB_VERSION in usb_config.h"
#undef CHERRYUSB_VERSION
#endif
#ifdef CHERRYUSB_VERSION_STR
#warning "Please do not define CHERRYUSB_VERSION_STR in usb_config.h"
#undef CHERRYUSB_VERSION_STR
#endif
#define CHERRYUSB_VERSION 0x010301
#define CHERRYUSB_VERSION_STR "v1.3.1"
#endif

View File

@ -23,6 +23,7 @@ extern "C" {
#include "usb_log.h"
#include "usb_dc.h"
#include "usb_memcpy.h"
#include "usb_version.h"
enum usbd_event_type {
/* USB DCD IRQ */

View File

@ -21,6 +21,7 @@
#include "usb_osal.h"
#include "usbh_hub.h"
#include "usb_memcpy.h"
#include "usb_version.h"
#ifdef __cplusplus
extern "C" {

View File

@ -6,9 +6,6 @@
#pragma once
#define CHERRYUSB_VERSION 0x010301
#define CHERRYUSB_VERSION_STR "v1.3.1"
#include "sdkconfig.h"
#include "esp_rom_sys.h"

View File

@ -15,9 +15,6 @@
#include "FreeRTOS.h"
#include "task.h"
#define CHERRYUSB_VERSION 0x010400
#define CHERRYUSB_VERSION_STR "v1.4.0"
/* ================ USB common Configuration ================ */
#define CONFIG_USB_PRINTF(...) printf(__VA_ARGS__)

View File

@ -13,9 +13,6 @@
#include "rtconfig.h"
#define CHERRYUSB_VERSION 0x010400
#define CHERRYUSB_VERSION_STR "v1.4.0"
/* ================ USB common Configuration ================ */
#define CONFIG_USB_PRINTF(...) rt_kprintf(__VA_ARGS__)

View File

@ -13,9 +13,6 @@
#include "sdkconfig.h"
#define CHERRYUSB_VERSION 0x010400
#define CHERRYUSB_VERSION_STR "v1.4.0"
/* ================ USB common Configuration ================ */
#define CONFIG_USB_PRINTF(...) printf(__VA_ARGS__)

View File

@ -16,9 +16,6 @@
#include "FreeRTOS.h"
#include "task.h"
#define CHERRYUSB_VERSION 0x010400
#define CHERRYUSB_VERSION_STR "v1.4.0"
/* ================ USB common Configuration ================ */
#define CONFIG_USB_PRINTF(...) printf(__VA_ARGS__)

View File

@ -13,9 +13,6 @@
#include "rtthread.h"
#define CHERRYUSB_VERSION 0x010400
#define CHERRYUSB_VERSION_STR "v1.4.0"
/* ================ USB common Configuration ================ */
#define CONFIG_USB_PRINTF(...) rt_kprintf(__VA_ARGS__)