Merge pull request #389 from PavelSindler/fw_versions

development fw versions has initial message for warning
This commit is contained in:
bubnikv 2018-01-11 17:12:25 +01:00 committed by GitHub
commit 52315d7382
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 74 additions and 9 deletions

View file

@ -8,11 +8,16 @@
#define STR(x) STR_HELPER(x) #define STR(x) STR_HELPER(x)
// Firmware version // Firmware version
#define FW_version "3.1.1-RC4" #define FW_VERSION "3.1.1-RC4"
#define FW_build 143 #define FW_COMMIT_NR 143
//#define FW_build --BUILD-NUMBER-- #define FW_DEV_VERSION FW_VERSION_RC
#define FW_version_build FW_version " b" STR(FW_build) "f" #define FW_VERSION_FULL FW_VERSION "-" STR(FW_COMMIT_NR)
#define FW_VERSION_UNKNOWN 4
#define FW_VERSION_ALPHA 3
#define FW_VERSION_BETA 2
#define FW_VERSION_RC 1
#define FW_VERSION_GOLD 0
#define FW_PRUSA3D_MAGIC "PRUSA3DFW" #define FW_PRUSA3D_MAGIC "PRUSA3DFW"
#define FW_PRUSA3D_MAGIC_LEN 10 #define FW_PRUSA3D_MAGIC_LEN 10

View file

@ -369,6 +369,7 @@ void bed_analysis(float x_dimension, float y_dimension, int x_points_num, int y_
float temp_comp_interpolation(float temperature); float temp_comp_interpolation(float temperature);
void temp_compensation_apply(); void temp_compensation_apply();
void temp_compensation_start(); void temp_compensation_start();
void show_fw_version_warnings();
#ifdef PINDA_THERMISTOR #ifdef PINDA_THERMISTOR
float temp_compensation_pinda_thermistor_offset(float temperature_pinda); float temp_compensation_pinda_thermistor_offset(float temperature_pinda);

View file

@ -886,6 +886,17 @@ void factory_reset()
KEEPALIVE_STATE(IN_HANDLER); KEEPALIVE_STATE(IN_HANDLER);
} }
void show_fw_version_warnings() {
if (FW_DEV_VERSION == FW_VERSION_GOLD) return;
switch (FW_DEV_VERSION) {
case(FW_VERSION_ALPHA): lcd_show_fullscreen_message_and_wait_P(MSG_FW_VERSION_ALPHA); break;
case(FW_VERSION_BETA): lcd_show_fullscreen_message_and_wait_P(MSG_FW_VERSION_BETA); break;
case(FW_VERSION_RC): lcd_show_fullscreen_message_and_wait_P(MSG_FW_VERSION_RC); break;
default: lcd_show_fullscreen_message_and_wait_P(MSG_FW_VERSION_UNKNOWN); break;
}
lcd_update_enable(true);
}
// "Setup" function is called by the Arduino framework on startup. // "Setup" function is called by the Arduino framework on startup.
// Before startup, the Timers-functions (PWM)/Analog RW and HardwareSerial provided by the Arduino-code // Before startup, the Timers-functions (PWM)/Analog RW and HardwareSerial provided by the Arduino-code
// are initialized by the main() routine provided by the Arduino framework. // are initialized by the main() routine provided by the Arduino framework.
@ -914,7 +925,7 @@ void setup()
stdout = uartout; stdout = uartout;
SERIAL_PROTOCOLLNPGM("start"); SERIAL_PROTOCOLLNPGM("start");
SERIAL_ECHO_START; SERIAL_ECHO_START;
printf_P(PSTR(" "FW_version_build"\n")); printf_P(PSTR(" "FW_VERSION_FULL"\n"));
#if 0 #if 0
SERIAL_ECHOLN("Reading eeprom from 0 to 100: start"); SERIAL_ECHOLN("Reading eeprom from 0 to 100: start");
@ -1122,6 +1133,9 @@ void setup()
#ifndef DEBUG_DISABLE_STARTMSGS #ifndef DEBUG_DISABLE_STARTMSGS
KEEPALIVE_STATE(PAUSED_FOR_USER); KEEPALIVE_STATE(PAUSED_FOR_USER);
show_fw_version_warnings();
if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) == 1) { if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) == 1) {
lcd_wizard(0); lcd_wizard(0);
} }
@ -2296,7 +2310,7 @@ void process_commands()
} else if(code_seen("Fir")){ } else if(code_seen("Fir")){
SERIAL_PROTOCOLLN(FW_version); SERIAL_PROTOCOLLN(FW_VERSION);
} else if(code_seen("Rev")){ } else if(code_seen("Rev")){

View file

@ -817,6 +817,34 @@ const char * const MSG_FSENS_NOT_RESPONDING_LANG_TABLE[LANG_NUM] PROGMEM = {
MSG_FSENS_NOT_RESPONDING_CZ MSG_FSENS_NOT_RESPONDING_CZ
}; };
const char MSG_FW_VERSION_ALPHA_EN[] PROGMEM = "You are using firmware alpha version. This is development version. Using this version is not recommended and may cause printer damage.";
const char MSG_FW_VERSION_ALPHA_CZ[] PROGMEM = "Pouzivate alpha verzi firmwaru. Jedna se o vyvojovou verzi. Pouzivani teto verze firmware neni doporuceno a muze zpusobit poskozeni tiskarny.";
const char * const MSG_FW_VERSION_ALPHA_LANG_TABLE[LANG_NUM] PROGMEM = {
MSG_FW_VERSION_ALPHA_EN,
MSG_FW_VERSION_ALPHA_CZ
};
const char MSG_FW_VERSION_BETA_EN[] PROGMEM = "You are using firmware beta version. This is development version. Using this version is not recommended and may cause printer damage.";
const char MSG_FW_VERSION_BETA_CZ[] PROGMEM = "Pouzivate beta verzi firmwaru. Jedna se o vyvojovou verzi. Pouzivani teto verze firmware neni doporuceno a muze zpusobit poskozeni tiskarny.";
const char * const MSG_FW_VERSION_BETA_LANG_TABLE[LANG_NUM] PROGMEM = {
MSG_FW_VERSION_BETA_EN,
MSG_FW_VERSION_BETA_CZ
};
const char MSG_FW_VERSION_RC_EN[] PROGMEM = "This firmware version is release candidate. Some of the features may not work properly.";
const char MSG_FW_VERSION_RC_CZ[] PROGMEM = "Tato verze firmware je release candidate. Nektere z funkci nemusi pracovat spolehlive.";
const char * const MSG_FW_VERSION_RC_LANG_TABLE[LANG_NUM] PROGMEM = {
MSG_FW_VERSION_RC_EN,
MSG_FW_VERSION_RC_CZ
};
const char MSG_FW_VERSION_UNKNOWN_EN[] PROGMEM = "WARNING: Unknown firmware version";
const char MSG_FW_VERSION_UNKNOWN_CZ[] PROGMEM = "VAROVANI: Neznama verze firmware";
const char * const MSG_FW_VERSION_UNKNOWN_LANG_TABLE[LANG_NUM] PROGMEM = {
MSG_FW_VERSION_UNKNOWN_EN,
MSG_FW_VERSION_UNKNOWN_CZ
};
const char MSG_HEATING_EN[] PROGMEM = "Heating"; const char MSG_HEATING_EN[] PROGMEM = "Heating";
const char MSG_HEATING_CZ[] PROGMEM = "Zahrivani"; const char MSG_HEATING_CZ[] PROGMEM = "Zahrivani";
const char * const MSG_HEATING_LANG_TABLE[LANG_NUM] PROGMEM = { const char * const MSG_HEATING_LANG_TABLE[LANG_NUM] PROGMEM = {

View file

@ -282,6 +282,14 @@ extern const char* const MSG_FSENS_AUTOLOAD_ON_LANG_TABLE[LANG_NUM];
#define MSG_FSENS_AUTOLOAD_ON LANG_TABLE_SELECT(MSG_FSENS_AUTOLOAD_ON_LANG_TABLE) #define MSG_FSENS_AUTOLOAD_ON LANG_TABLE_SELECT(MSG_FSENS_AUTOLOAD_ON_LANG_TABLE)
extern const char* const MSG_FSENS_NOT_RESPONDING_LANG_TABLE[LANG_NUM]; extern const char* const MSG_FSENS_NOT_RESPONDING_LANG_TABLE[LANG_NUM];
#define MSG_FSENS_NOT_RESPONDING LANG_TABLE_SELECT(MSG_FSENS_NOT_RESPONDING_LANG_TABLE) #define MSG_FSENS_NOT_RESPONDING LANG_TABLE_SELECT(MSG_FSENS_NOT_RESPONDING_LANG_TABLE)
extern const char* const MSG_FW_VERSION_ALPHA_LANG_TABLE[LANG_NUM];
#define MSG_FW_VERSION_ALPHA LANG_TABLE_SELECT(MSG_FW_VERSION_ALPHA_LANG_TABLE)
extern const char* const MSG_FW_VERSION_BETA_LANG_TABLE[LANG_NUM];
#define MSG_FW_VERSION_BETA LANG_TABLE_SELECT(MSG_FW_VERSION_BETA_LANG_TABLE)
extern const char* const MSG_FW_VERSION_RC_LANG_TABLE[LANG_NUM];
#define MSG_FW_VERSION_RC LANG_TABLE_SELECT(MSG_FW_VERSION_RC_LANG_TABLE)
extern const char* const MSG_FW_VERSION_UNKNOWN_LANG_TABLE[LANG_NUM];
#define MSG_FW_VERSION_UNKNOWN LANG_TABLE_SELECT(MSG_FW_VERSION_UNKNOWN_LANG_TABLE)
extern const char* const MSG_HEATING_LANG_TABLE[LANG_NUM]; extern const char* const MSG_HEATING_LANG_TABLE[LANG_NUM];
#define MSG_HEATING LANG_TABLE_SELECT(MSG_HEATING_LANG_TABLE) #define MSG_HEATING LANG_TABLE_SELECT(MSG_HEATING_LANG_TABLE)
extern const char* const MSG_HEATING_COMPLETE_LANG_TABLE[LANG_NUM]; extern const char* const MSG_HEATING_COMPLETE_LANG_TABLE[LANG_NUM];

View file

@ -397,3 +397,8 @@ ve
#define(length=20, lines=4) MSG_FSENS_NOT_RESPONDING "CHYBA: Filament senzor nereaguje, zkontrolujte zapojeni." #define(length=20, lines=4) MSG_FSENS_NOT_RESPONDING "CHYBA: Filament senzor nereaguje, zkontrolujte zapojeni."
#define(length=20, lines=8) MSG_FW_VERSION_UNKNOWN "VAROVANI: Neznama verze firmware"
#define(length=20, lines=8) MSG_FW_VERSION_ALPHA "Pouzivate alpha verzi firmwaru. Jedna se o vyvojovou verzi. Pouzivani teto verze firmware neni doporuceno a muze zpusobit poskozeni tiskarny."
#define(length=20, lines=8) MSG_FW_VERSION_BETA "Pouzivate beta verzi firmwaru. Jedna se o vyvojovou verzi. Pouzivani teto verze firmware neni doporuceno a muze zpusobit poskozeni tiskarny."
#define(length=20, lines=8) MSG_FW_VERSION_RC "Tato verze firmware je release candidate. Nektere z funkci nemusi pracovat spolehlive."

View file

@ -402,3 +402,7 @@
#define(length=20, lines=4) MSG_AUTOLOADING_ONLY_IF_FSENS_ON "Autoloading filament available only when filament sensor is turned on..." #define(length=20, lines=4) MSG_AUTOLOADING_ONLY_IF_FSENS_ON "Autoloading filament available only when filament sensor is turned on..."
#define(length=20, lines=4) MSG_FSENS_NOT_RESPONDING "ERROR: Filament sensor is not responding, please check connection." #define(length=20, lines=4) MSG_FSENS_NOT_RESPONDING "ERROR: Filament sensor is not responding, please check connection."
#define(length=20, lines=8) MSG_FW_VERSION_UNKNOWN "WARNING: Unknown firmware version"
#define(length=20, lines=8) MSG_FW_VERSION_ALPHA "You are using firmware alpha version. This is development version. Using this version is not recommended and may cause printer damage."
#define(length=20, lines=8) MSG_FW_VERSION_BETA "You are using firmware beta version. This is development version. Using this version is not recommended and may cause printer damage."
#define(length=20, lines=8) MSG_FW_VERSION_RC "This firmware version is release candidate. Some of the features may not work properly."

View file

@ -1665,7 +1665,7 @@ static void lcd_support_menu()
MENU_ITEM(back, MSG_MAIN, lcd_main_menu); MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
MENU_ITEM(back, PSTR("Firmware:"), lcd_main_menu); MENU_ITEM(back, PSTR("Firmware:"), lcd_main_menu);
MENU_ITEM(back, PSTR(" " FW_version_build), lcd_main_menu); MENU_ITEM(back, PSTR(" " FW_VERSION_FULL), lcd_main_menu);
// Ideally this block would be optimized out by the compiler. // Ideally this block would be optimized out by the compiler.
/* const uint8_t fw_string_len = strlen_P(FW_VERSION_STR_P()); /* const uint8_t fw_string_len = strlen_P(FW_VERSION_STR_P());
if (fw_string_len < 6) { if (fw_string_len < 6) {
@ -3133,7 +3133,7 @@ static void prusa_stat_printinfo()
SERIAL_ECHO(0); SERIAL_ECHO(0);
} }
SERIAL_ECHO("][FWR:"); SERIAL_ECHO("][FWR:");
SERIAL_ECHO(FW_version); SERIAL_ECHO(FW_VERSION);
SERIAL_ECHO("]"); SERIAL_ECHO("]");
} }

View file

@ -5,7 +5,7 @@
#include "util.h" #include "util.h"
// Allocate the version string in the program memory. Otherwise the string lands either on the stack or in the global RAM. // Allocate the version string in the program memory. Otherwise the string lands either on the stack or in the global RAM.
const char FW_VERSION_STR[] PROGMEM = FW_version; const char FW_VERSION_STR[] PROGMEM = FW_VERSION;
const char* FW_VERSION_STR_P() const char* FW_VERSION_STR_P()
{ {