Vendor version override (#14189)

Co-Authored-By: InsanityAutomation <insanityautomation@users.noreply.github.com>
This commit is contained in:
InsanityAutomation
2019-10-15 13:32:44 -04:00
committed by Scott Lahteine
parent 7622973a31
commit 0074d63962
134 changed files with 410 additions and 104 deletions

View File

@ -72,6 +72,7 @@
// Author info of this build printed to the host during boot and M115
#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes)
/**
* *** VENDORS PLEASE READ ***

76
Marlin/Version.h Normal file
View File

@ -0,0 +1,76 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
////////////////////////////
// VENDOR VERSION EXAMPLE //
////////////////////////////
/**
* Marlin release version identifier
*/
//#define SHORT_BUILD_VERSION "bugfix-2.0.x"
/**
* Verbose version identifier which should contain a reference to the location
* from where the binary was downloaded or the source code was compiled.
*/
//#define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION " (Github)"
/**
* The STRING_DISTRIBUTION_DATE represents when the binary file was built,
* here we define this default string as the date where the latest release
* version was tagged.
*/
//#define STRING_DISTRIBUTION_DATE "2019-07-10"
/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
*/
//#define MACHINE_NAME "3D Printer"
/**
* The SOURCE_CODE_URL is the location where users will find the Marlin Source
* Code which is installed on the device. In most cases —unless the manufacturer
* has a distinct Github fork— the Source Code URL should just be the main
* Marlin repository.
*/
//#define SOURCE_CODE_URL "https://github.com/MarlinFirmware/Marlin"
/**
* Default generic printer UUID.
*/
//#define DEFAULT_MACHINE_UUID "cede2a2f-41a2-4748-9b12-c55c62f367ff"
/**
* The WEBSITE_URL is the location where users can get more information such as
* documentation about a specific Marlin release.
*/
//#define WEBSITE_URL "http://marlinfw.org"
/**
* Set the vendor info the serial USB interface, if changable
* Currently only supported by DUE platform
*/
//#define USB_DEVICE_VENDOR_ID 0x0000
//#define USB_DEVICE_PRODUCT_ID 0x0000
//#define USB_DEVICE_MANUFACTURE_NAME WEBSITE_URL

View File

@ -48,9 +48,7 @@
#define _CONF_USB_H_
#undef UNUSED /* To avoid a macro clash as macros.h already defines it */
#include "../../../core/macros.h" /* For ENABLED()/DISABLED() */
#include "../../../core/boards.h" /* For MB() */
#include "../../../../Configuration.h" /* For CUSTOM_MACHINE_NAME definition - We just need the name, no C++ allowed! */
#include "../../../inc/MarlinConfigPre.h"
#include "compiler.h"
/**
@ -59,8 +57,6 @@
*/
//! Device definition (mandatory)
#define USB_DEVICE_VENDOR_ID 0x03EB /* ATMEL VID */
#define USB_DEVICE_PRODUCT_ID 0x2424 /* MSC / CDC */
#define USB_DEVICE_MAJOR_VERSION 1
#define USB_DEVICE_MINOR_VERSION 0
#define USB_DEVICE_POWER 100 // Consumption on Vbus line (mA)
@ -70,15 +66,6 @@
// (USB_CONFIG_ATTR_REMOTE_WAKEUP|USB_CONFIG_ATTR_SELF_POWERED)
// (USB_CONFIG_ATTR_REMOTE_WAKEUP|USB_CONFIG_ATTR_BUS_POWERED)
//! USB Device string definitions (Optional)
#define USB_DEVICE_MANUFACTURE_NAME "marlinfw.org"
#ifdef CUSTOM_MACHINE_NAME
#define USB_DEVICE_PRODUCT_NAME CUSTOM_MACHINE_NAME
#else
#define USB_DEVICE_PRODUCT_NAME "3D Printer"
#endif
#define USB_DEVICE_SERIAL_NAME "123985739853"
/**
* Device speeds support
* Low speed not supported by CDC and MSC

View File

@ -1768,23 +1768,25 @@
#define Z_STEPPER_COUNT 1
#endif
// Get LCD character width/height, which may be overridden by pins, configs, etc.
#ifndef LCD_WIDTH
#if HAS_GRAPHICAL_LCD
#define LCD_WIDTH 21
#elif ENABLED(ULTIPANEL)
#define LCD_WIDTH 20
#elif HAS_SPI_LCD
#define LCD_WIDTH 16
#if HAS_SPI_LCD
// Get LCD character width/height, which may be overridden by pins, configs, etc.
#ifndef LCD_WIDTH
#if HAS_GRAPHICAL_LCD
#define LCD_WIDTH 21
#elif ENABLED(ULTIPANEL)
#define LCD_WIDTH 20
#else
#define LCD_WIDTH 16
#endif
#endif
#endif
#ifndef LCD_HEIGHT
#if HAS_GRAPHICAL_LCD
#define LCD_HEIGHT 5
#elif ENABLED(ULTIPANEL)
#define LCD_HEIGHT 4
#elif HAS_SPI_LCD
#define LCD_HEIGHT 2
#ifndef LCD_HEIGHT
#if HAS_GRAPHICAL_LCD
#define LCD_HEIGHT 5
#elif ENABLED(ULTIPANEL)
#define LCD_HEIGHT 4
#else
#define LCD_HEIGHT 2
#endif
#endif
#endif

View File

@ -34,9 +34,21 @@
#include "../core/boards.h"
#include "../core/macros.h"
#include "Version.h"
#include "../../Configuration.h"
#ifdef CUSTOM_VERSION_FILE
#if defined(__has_include)
#if __has_include(CUSTOM_VERSION_FILE)
#include XSTR(../../CUSTOM_VERSION_FILE)
#endif
#else
#include XSTR(../../CUSTOM_VERSION_FILE)
#endif
#endif
#include "Version.h"
#include "Conditionals_LCD.h"
#include HAL_PATH(../HAL, inc/Conditionals_LCD.h)

View File

@ -74,7 +74,9 @@
#elif defined(CUSTOM_MENDEL_NAME)
#error "CUSTOM_MENDEL_NAME is now CUSTOM_MACHINE_NAME. Please update your configuration."
#elif defined(HAS_AUTOMATIC_VERSIONING)
#error "HAS_AUTOMATIC_VERSIONING is now USE_AUTOMATIC_VERSIONING. Please update your configuration."
#error "HAS_AUTOMATIC_VERSIONING is now CUSTOM_VERSION_FILE. Please update your configuration."
#elif defined(USE_AUTOMATIC_VERSIONING)
#error "USE_AUTOMATIC_VERSIONING is now CUSTOM_VERSION_FILE. Please update your configuration."
#elif defined(SDSLOW)
#error "SDSLOW deprecated. Set SPI_SPEED to SPI_HALF_SPEED instead."
#elif defined(SDEXTRASLOW)

View File

@ -21,77 +21,102 @@
*/
#pragma once
#include "../core/macros.h" // for ENABLED
/**
* Release version. Leave the Marlin version or apply a custom scheme.
*/
#ifndef SHORT_BUILD_VERSION
#define SHORT_BUILD_VERSION "bugfix-2.0.x"
#endif
/**
* This file is the standard Marlin version identifier file.
* Use -DUSE_AUTOMATIC_VERSIONING=1 and a custom _Version.h
* to override these values.
* Verbose version identifier containing a unique identifier, such as the
* vendor name, download location, GitHub account, etc.
*/
#ifndef DETAILED_BUILD_VERSION
#define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION " (GitHub)"
#endif
/**
* The STRING_DISTRIBUTION_DATE represents when the binary file was built,
* here we define this default string as the date where the latest release
* version was tagged.
*/
#ifndef STRING_DISTRIBUTION_DATE
#define STRING_DISTRIBUTION_DATE "2019-10-10"
#endif
/**
* Minimum Configuration.h and Configuration_adv.h file versions.
* Set based on the release version number. Used to catch an attempt to use
* older configurations. Override these if using a custom versioning scheme
* to alert users to major changes.
*/
#if ENABLED(USE_AUTOMATIC_VERSIONING)
#define MARLIN_HEX_VERSION 020000
#ifndef REQUIRED_CONFIGURATION_H_VERSION
#define REQUIRED_CONFIGURATION_H_VERSION MARLIN_HEX_VERSION
#endif
#ifndef REQUIRED_CONFIGURATION_ADV_H_VERSION
#define REQUIRED_CONFIGURATION_ADV_H_VERSION MARLIN_HEX_VERSION
#endif
#include "_Version.h"
#else
/**
* Marlin release version identifier
*/
#define SHORT_BUILD_VERSION "bugfix-2.0.x"
/**
* Verbose version identifier which should contain a reference to the location
* from where the binary was downloaded or the source code was compiled.
*/
#define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION " (Github)"
/**
* The STRING_DISTRIBUTION_DATE represents when the binary file was built,
* here we define this default string as the date where the latest release
* version was tagged.
*/
#define STRING_DISTRIBUTION_DATE "2019-10-10"
/**
* Required minimum Configuration.h and Configuration_adv.h file versions.
*
* You must increment this version number for every significant change such as,
* but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option on
* the configuration files.
*/
#define REQUIRED_CONFIGURATION_H_VERSION 020000
#define REQUIRED_CONFIGURATION_ADV_H_VERSION 020000
/**
* The protocol for communication to the host. Protocol indicates communication
* standards such as the use of ASCII, "echo:" and "error:" line prefixes, etc.
* (Other behaviors are given by the firmware version and capabilities report.)
*/
/**
* The protocol for communication to the host. Protocol indicates communication
* standards such as the use of ASCII, "echo:" and "error:" line prefixes, etc.
* (Other behaviors are given by the firmware version and capabilities report.)
*/
#ifndef PROTOCOL_VERSION
#define PROTOCOL_VERSION "1.0"
#endif
/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
*/
/**
* Define a generic printer name to be output to the LCD after booting Marlin.
*/
#ifndef MACHINE_NAME
#define MACHINE_NAME "3D Printer"
#endif
/**
* The SOURCE_CODE_URL is the location where users will find the Marlin Source
* Code which is installed on the device. In most cases —unless the manufacturer
* has a distinct Github fork— the Source Code URL should just be the main
* Marlin repository.
*/
/**
* Website where users can find Marlin source code for the binary installed on the
* device. Override this if you provide public source code download. (GPLv3 requires
* providing the source code to your customers.)
*/
#ifndef SOURCE_CODE_URL
#define SOURCE_CODE_URL "https://github.com/MarlinFirmware/Marlin"
#endif
/**
* Default generic printer UUID.
*/
/**
* Default generic printer UUID.
*/
#ifndef DEFAULT_MACHINE_UUID
#define DEFAULT_MACHINE_UUID "cede2a2f-41a2-4748-9b12-c55c62f367ff"
#endif
/**
* The WEBSITE_URL is the location where users can get more information such as
* documentation about a specific Marlin release. Displayed in the Info Menu.
*/
#ifndef WEBSITE_URL
#define WEBSITE_URL "http://marlinfw.org"
#endif
#endif // USE_AUTOMATIC_VERSIONING
/**
* Set the vendor info the serial USB interface, if changable
* Currently only supported by DUE platform
*/
#ifndef USB_DEVICE_VENDOR_ID
#define USB_DEVICE_VENDOR_ID 0x03EB /* ATMEL VID */
#endif
#ifndef USB_DEVICE_PRODUCT_ID
#define USB_DEVICE_PRODUCT_ID 0x2424 /* MSC / CDC */
#endif
//! USB Device string definitions (Optional)
#ifndef USB_DEVICE_MANUFACTURE_NAME
#define USB_DEVICE_MANUFACTURE_NAME WEBSITE_URL
#endif
#ifdef CUSTOM_MACHINE_NAME
#define USB_DEVICE_PRODUCT_NAME CUSTOM_MACHINE_NAME
#else
#define USB_DEVICE_PRODUCT_NAME MACHINE_NAME
#endif
#define USB_DEVICE_SERIAL_NAME "123985739853"