Move farm mode to separate file
This commit is contained in:
parent
4e7d686b83
commit
7d597eb8b0
@ -567,5 +567,7 @@ enum CalibrationStatus
|
|||||||
#include "Configuration_adv.h"
|
#include "Configuration_adv.h"
|
||||||
#include "thermistortables.h"
|
#include "thermistortables.h"
|
||||||
|
|
||||||
|
#define PRUSA_FARM
|
||||||
|
|
||||||
|
|
||||||
#endif //__CONFIGURATION_H
|
#endif //__CONFIGURATION_H
|
||||||
|
@ -81,6 +81,7 @@
|
|||||||
#include "math.h"
|
#include "math.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
|
#include "Prusa_farm.h"
|
||||||
|
|
||||||
#include <avr/wdt.h>
|
#include <avr/wdt.h>
|
||||||
#include <avr/pgmspace.h>
|
#include <avr/pgmspace.h>
|
||||||
|
3
Firmware/Prusa_farm.cpp
Normal file
3
Firmware/Prusa_farm.cpp
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#include "Prusa_farm.h"
|
||||||
|
|
||||||
|
uint8_t farm_mode = 0;
|
11
Firmware/Prusa_farm.h
Normal file
11
Firmware/Prusa_farm.h
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <inttypes.h>
|
||||||
|
#include "Configuration.h"
|
||||||
|
|
||||||
|
#ifdef PRUSA_FARM
|
||||||
|
extern uint8_t farm_mode;
|
||||||
|
#else
|
||||||
|
#define farm_mode 0
|
||||||
|
#error prusa_farm_include_error
|
||||||
|
#endif
|
@ -7,6 +7,7 @@
|
|||||||
#include "stepper.h"
|
#include "stepper.h"
|
||||||
#include "temperature.h"
|
#include "temperature.h"
|
||||||
#include "language.h"
|
#include "language.h"
|
||||||
|
#include "Prusa_farm.h"
|
||||||
|
|
||||||
#ifdef SDSUPPORT
|
#ifdef SDSUPPORT
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include "cmdqueue.h"
|
#include "cmdqueue.h"
|
||||||
#include "cardreader.h"
|
#include "cardreader.h"
|
||||||
#include "ultralcd.h"
|
#include "ultralcd.h"
|
||||||
|
#include "Prusa_farm.h"
|
||||||
|
|
||||||
// Reserve BUFSIZE lines of length MAX_CMD_SIZE plus CMDBUFFER_RESERVE_FRONT.
|
// Reserve BUFSIZE lines of length MAX_CMD_SIZE plus CMDBUFFER_RESERVE_FRONT.
|
||||||
char cmdbuffer[BUFSIZE * (MAX_CMD_SIZE + 1) + CMDBUFFER_RESERVE_FRONT];
|
char cmdbuffer[BUFSIZE * (MAX_CMD_SIZE + 1) + CMDBUFFER_RESERVE_FRONT];
|
||||||
|
@ -45,6 +45,7 @@
|
|||||||
#include "ConfigurationStore.h"
|
#include "ConfigurationStore.h"
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
#include "Configuration_prusa.h"
|
#include "Configuration_prusa.h"
|
||||||
|
#include "Prusa_farm.h"
|
||||||
|
|
||||||
#if (ADC_OVRSAMPL != OVERSAMPLENR)
|
#if (ADC_OVRSAMPL != OVERSAMPLENR)
|
||||||
#error "ADC_OVRSAMPL oversampling must match OVERSAMPLENR"
|
#error "ADC_OVRSAMPL oversampling must match OVERSAMPLENR"
|
||||||
|
@ -53,6 +53,7 @@
|
|||||||
#include "la10compat.h"
|
#include "la10compat.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "Prusa_farm.h"
|
||||||
|
|
||||||
int clock_interval = 0;
|
int clock_interval = 0;
|
||||||
static ShortTimer NcTime;
|
static ShortTimer NcTime;
|
||||||
@ -81,7 +82,6 @@ CustomMsg custom_message_type = CustomMsg::Status;
|
|||||||
uint8_t custom_message_state = 0;
|
uint8_t custom_message_state = 0;
|
||||||
|
|
||||||
bool isPrintPaused = false;
|
bool isPrintPaused = false;
|
||||||
uint8_t farm_mode = 0;
|
|
||||||
uint8_t farm_timer = 8;
|
uint8_t farm_timer = 8;
|
||||||
bool printer_connected = true;
|
bool printer_connected = true;
|
||||||
|
|
||||||
@ -5929,12 +5929,9 @@ static void lcd_main_menu()
|
|||||||
if (card.cardOK || lcd_commands_type == LcdCommands::Layer1Cal) {
|
if (card.cardOK || lcd_commands_type == LcdCommands::Layer1Cal) {
|
||||||
if (!card.isFileOpen()) {
|
if (!card.isFileOpen()) {
|
||||||
if (!usb_timer.running() && (lcd_commands_type != LcdCommands::Layer1Cal)) {
|
if (!usb_timer.running() && (lcd_commands_type != LcdCommands::Layer1Cal)) {
|
||||||
//if (farm_mode) MENU_ITEM_SUBMENU_P(MSG_FARM_CARD_MENU, lcd_farm_sdcard_menu);
|
bMain=true; // flag ('fake parameter') for 'lcd_sdcard_menu()' function
|
||||||
/*else*/{
|
MENU_ITEM_SUBMENU_P(_T(MSG_CARD_MENU), lcd_sdcard_menu);
|
||||||
bMain=true; // flag ('fake parameter') for 'lcd_sdcard_menu()' function
|
}
|
||||||
MENU_ITEM_SUBMENU_P(_T(MSG_CARD_MENU), lcd_sdcard_menu);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#if SDCARDDETECT < 1
|
#if SDCARDDETECT < 1
|
||||||
MENU_ITEM_GCODE_P(_i("Change SD card"), PSTR("M21")); // SD-card changed by user////MSG_CNG_SDCARD
|
MENU_ITEM_GCODE_P(_i("Change SD card"), PSTR("M21")); // SD-card changed by user////MSG_CNG_SDCARD
|
||||||
#endif //SDCARDDETECT
|
#endif //SDCARDDETECT
|
||||||
|
@ -130,8 +130,6 @@ enum class CustomMsg : uint_least8_t
|
|||||||
extern CustomMsg custom_message_type;
|
extern CustomMsg custom_message_type;
|
||||||
extern uint8_t custom_message_state;
|
extern uint8_t custom_message_state;
|
||||||
|
|
||||||
extern uint8_t farm_mode;
|
|
||||||
|
|
||||||
extern bool UserECoolEnabled();
|
extern bool UserECoolEnabled();
|
||||||
extern bool FarmOrUserECool();
|
extern bool FarmOrUserECool();
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#include "language.h"
|
#include "language.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include <avr/pgmspace.h>
|
#include <avr/pgmspace.h>
|
||||||
|
#include "Prusa_farm.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.
|
||||||
static const char FW_VERSION_STR[] PROGMEM = FW_VERSION;
|
static const char FW_VERSION_STR[] PROGMEM = FW_VERSION;
|
||||||
|
Loading…
Reference in New Issue
Block a user