Info Menu: Runaway Watch state (#14827)
This commit is contained in:
parent
81b9c7c6ee
commit
7e72768433
@ -44,7 +44,7 @@ bool PersistentStore::access_finish() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) {
|
||||||
while (size--) {
|
while (size--) {
|
||||||
uint8_t * const p = (uint8_t * const)pos;
|
uint8_t * const p = (uint8_t * const)pos;
|
||||||
uint8_t v = *value;
|
uint8_t v = *value;
|
||||||
|
@ -72,7 +72,7 @@ bool PersistentStore::access_finish() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) {
|
||||||
if (!eeprom_file.seek(pos)) return true; // return true for any error
|
if (!eeprom_file.seek(pos)) return true; // return true for any error
|
||||||
if (eeprom_file.write(value, size) != size) return true;
|
if (eeprom_file.write(value, size) != size) return true;
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ bool PersistentStore::access_finish() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) {
|
||||||
for (size_t i = 0; i < size; i++) ram_eeprom[pos + i] = value[i];
|
for (size_t i = 0; i < size; i++) ram_eeprom[pos + i] = value[i];
|
||||||
eeprom_dirty = true;
|
eeprom_dirty = true;
|
||||||
crc16(crc, value, size);
|
crc16(crc, value, size);
|
||||||
|
@ -58,7 +58,7 @@ bool PersistentStore::access_finish() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) {
|
||||||
#if NONE(SPI_EEPROM, I2C_EEPROM)
|
#if NONE(SPI_EEPROM, I2C_EEPROM)
|
||||||
if (NVMCTRL->SEESTAT.bit.RLOCK)
|
if (NVMCTRL->SEESTAT.bit.RLOCK)
|
||||||
NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_USEE); // Unlock E2P data write access
|
NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_USEE); // Unlock E2P data write access
|
||||||
|
@ -50,7 +50,7 @@ bool PersistentStore::access_finish() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) {
|
||||||
while (size--) {
|
while (size--) {
|
||||||
uint8_t v = *value;
|
uint8_t v = *value;
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ bool PersistentStore::access_start() {
|
|||||||
}
|
}
|
||||||
bool PersistentStore::access_finish() { return true; }
|
bool PersistentStore::access_finish() { return true; }
|
||||||
|
|
||||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) {
|
||||||
while (size--) {
|
while (size--) {
|
||||||
uint8_t * const p = (uint8_t * const)pos;
|
uint8_t * const p = (uint8_t * const)pos;
|
||||||
uint8_t v = *value;
|
uint8_t v = *value;
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
bool PersistentStore::access_start() { return true; }
|
bool PersistentStore::access_start() { return true; }
|
||||||
bool PersistentStore::access_finish() { return true; }
|
bool PersistentStore::access_finish() { return true; }
|
||||||
|
|
||||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) {
|
||||||
while (size--) {
|
while (size--) {
|
||||||
uint8_t * const p = (uint8_t * const)pos;
|
uint8_t * const p = (uint8_t * const)pos;
|
||||||
uint8_t v = *value;
|
uint8_t v = *value;
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
bool PersistentStore::access_start() { return true; }
|
bool PersistentStore::access_start() { return true; }
|
||||||
bool PersistentStore::access_finish() { return true; }
|
bool PersistentStore::access_finish() { return true; }
|
||||||
|
|
||||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) {
|
||||||
while (size--) {
|
while (size--) {
|
||||||
uint8_t * const p = (uint8_t * const)pos;
|
uint8_t * const p = (uint8_t * const)pos;
|
||||||
uint8_t v = *value;
|
uint8_t v = *value;
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
bool PersistentStore::access_start() { return true; }
|
bool PersistentStore::access_start() { return true; }
|
||||||
bool PersistentStore::access_finish() { return true; }
|
bool PersistentStore::access_finish() { return true; }
|
||||||
|
|
||||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) {
|
||||||
while (size--) {
|
while (size--) {
|
||||||
uint8_t * const p = (uint8_t * const)pos;
|
uint8_t * const p = (uint8_t * const)pos;
|
||||||
uint8_t v = *value;
|
uint8_t v = *value;
|
||||||
|
@ -31,7 +31,7 @@ class PersistentStore {
|
|||||||
public:
|
public:
|
||||||
static bool access_start();
|
static bool access_start();
|
||||||
static bool access_finish();
|
static bool access_finish();
|
||||||
static bool write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc);
|
static bool write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc);
|
||||||
static bool read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing=true);
|
static bool read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing=true);
|
||||||
static size_t capacity();
|
static size_t capacity();
|
||||||
|
|
||||||
|
@ -1194,6 +1194,13 @@
|
|||||||
#ifndef MSG_INFO_PROTOCOL
|
#ifndef MSG_INFO_PROTOCOL
|
||||||
#define MSG_INFO_PROTOCOL _UxGT("Protocol")
|
#define MSG_INFO_PROTOCOL _UxGT("Protocol")
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef MSG_INFO_RUNAWAY_OFF
|
||||||
|
#define MSG_INFO_RUNAWAY_OFF _UxGT("Runaway Watch: OFF")
|
||||||
|
#endif
|
||||||
|
#ifndef MSG_INFO_RUNAWAY_ON
|
||||||
|
#define MSG_INFO_RUNAWAY_ON _UxGT("Runaway Watch: ON")
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef MSG_CASE_LIGHT
|
#ifndef MSG_CASE_LIGHT
|
||||||
#define MSG_CASE_LIGHT _UxGT("Case Light")
|
#define MSG_CASE_LIGHT _UxGT("Case Light")
|
||||||
#endif
|
#endif
|
||||||
|
@ -102,6 +102,7 @@ void menu_info_thermistors() {
|
|||||||
char buffer[21]; // for STATIC_PAIR_P
|
char buffer[21]; // for STATIC_PAIR_P
|
||||||
|
|
||||||
START_SCREEN();
|
START_SCREEN();
|
||||||
|
|
||||||
#if EXTRUDERS
|
#if EXTRUDERS
|
||||||
#define THERMISTOR_ID TEMP_SENSOR_0
|
#define THERMISTOR_ID TEMP_SENSOR_0
|
||||||
#include "../thermistornames.h"
|
#include "../thermistornames.h"
|
||||||
@ -155,14 +156,57 @@ void menu_info_thermistors() {
|
|||||||
STATIC_PAIR_P(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_5_MAXTEMP), SS_LEFT);
|
STATIC_PAIR_P(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_5_MAXTEMP), SS_LEFT);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if EXTRUDERS
|
||||||
|
{
|
||||||
|
STATIC_ITEM(
|
||||||
|
#if WATCH_HOTENDS
|
||||||
|
MSG_INFO_RUNAWAY_ON
|
||||||
|
#else
|
||||||
|
MSG_INFO_RUNAWAY_OFF
|
||||||
|
#endif
|
||||||
|
, SS_LEFT
|
||||||
|
);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if HAS_HEATED_BED
|
#if HAS_HEATED_BED
|
||||||
|
{
|
||||||
#undef THERMISTOR_ID
|
#undef THERMISTOR_ID
|
||||||
#define THERMISTOR_ID TEMP_SENSOR_BED
|
#define THERMISTOR_ID TEMP_SENSOR_BED
|
||||||
#include "../thermistornames.h"
|
#include "../thermistornames.h"
|
||||||
STATIC_ITEM("TBed:" THERMISTOR_NAME, SS_INVERT);
|
STATIC_ITEM("TBed:" THERMISTOR_NAME, SS_INVERT);
|
||||||
STATIC_PAIR_P(MSG_INFO_MIN_TEMP, STRINGIFY(BED_MINTEMP), SS_LEFT);
|
STATIC_PAIR_P(MSG_INFO_MIN_TEMP, STRINGIFY(BED_MINTEMP), SS_LEFT);
|
||||||
STATIC_PAIR_P(MSG_INFO_MAX_TEMP, STRINGIFY(BED_MAXTEMP), SS_LEFT);
|
STATIC_PAIR_P(MSG_INFO_MAX_TEMP, STRINGIFY(BED_MAXTEMP), SS_LEFT);
|
||||||
|
STATIC_ITEM(
|
||||||
|
#if WATCH_BED
|
||||||
|
MSG_INFO_RUNAWAY_ON
|
||||||
|
#else
|
||||||
|
MSG_INFO_RUNAWAY_OFF
|
||||||
#endif
|
#endif
|
||||||
|
, SS_LEFT
|
||||||
|
);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if HAS_HEATED_CHAMBER
|
||||||
|
{
|
||||||
|
#undef THERMISTOR_ID
|
||||||
|
#define THERMISTOR_ID TEMP_SENSOR_CHAMBER
|
||||||
|
#include "../thermistornames.h"
|
||||||
|
STATIC_ITEM("TCham:" THERMISTOR_NAME, SS_INVERT);
|
||||||
|
STATIC_PAIR_P(MSG_INFO_MIN_TEMP, STRINGIFY(CHAMBER_MINTEMP), SS_LEFT);
|
||||||
|
STATIC_PAIR_P(MSG_INFO_MAX_TEMP, STRINGIFY(CHAMBER_MAXTEMP), SS_LEFT);
|
||||||
|
STATIC_ITEM(
|
||||||
|
#if WATCH_CHAMBER
|
||||||
|
MSG_INFO_RUNAWAY_ON
|
||||||
|
#else
|
||||||
|
MSG_INFO_RUNAWAY_OFF
|
||||||
|
#endif
|
||||||
|
, SS_LEFT
|
||||||
|
);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
END_SCREEN();
|
END_SCREEN();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user