Misc. formatting, serial out

This commit is contained in:
Scott Lahteine 2021-04-13 21:34:21 -05:00 committed by Scott Lahteine
parent e26eebfb2f
commit 326b1c1225
7 changed files with 855 additions and 856 deletions

View file

@ -320,8 +320,8 @@ void hook_cpu_exceptions() {
// So we'll simply mask the top 8 bits of the first handler as an hint of being in the flash or not -that's poor and will // So we'll simply mask the top 8 bits of the first handler as an hint of being in the flash or not -that's poor and will
// probably break if the flash happens to be more than 128MB, but in this case, we are not magician, we need help from outside. // probably break if the flash happens to be more than 128MB, but in this case, we are not magician, we need help from outside.
unsigned long * vecAddr = (unsigned long*)get_vtor(); unsigned long *vecAddr = (unsigned long*)get_vtor();
SERIAL_ECHO("Vector table addr: "); SERIAL_ECHOPGM("Vector table addr: ");
SERIAL_PRINTLN(get_vtor(), HEX); SERIAL_PRINTLN(get_vtor(), HEX);
#ifdef VECTOR_TABLE_SIZE #ifdef VECTOR_TABLE_SIZE
@ -348,7 +348,7 @@ void hook_cpu_exceptions() {
// 128 bytes alignement is required for writing the VTOR register // 128 bytes alignement is required for writing the VTOR register
alignas(128) static unsigned long vectable[VECTOR_TABLE_SENTINEL]; alignas(128) static unsigned long vectable[VECTOR_TABLE_SENTINEL];
SERIAL_ECHO("Detected vector table size: "); SERIAL_ECHOPGM("Detected vector table size: ");
SERIAL_PRINTLN(vec_size, HEX); SERIAL_PRINTLN(vec_size, HEX);
#endif #endif
@ -372,7 +372,7 @@ void hook_cpu_exceptions() {
HW_REG(0xE000ED08) = (unsigned long)vectable | _BV32(29); // 29th bit is for telling the CPU the table is now in SRAM (should be present already) HW_REG(0xE000ED08) = (unsigned long)vectable | _BV32(29); // 29th bit is for telling the CPU the table is now in SRAM (should be present already)
SERIAL_ECHOLN("Installed fault handlers"); SERIAL_ECHOLNPGM("Installed fault handlers");
#endif #endif
} }

View file

@ -28,11 +28,11 @@
// This is used like SERIAL_ECHOPAIR, that is: a key-value call of the local variables you want // This is used like SERIAL_ECHOPAIR, that is: a key-value call of the local variables you want
// to dump to the serial port before stopping the CPU. // to dump to the serial port before stopping the CPU.
// \/ Don't replace by SERIAL_ECHOPAIR since ONLY_FILENAME cannot be transformed to a PGM string on Arduino and it breaks building // \/ Don't replace by SERIAL_ECHOPAIR since ONLY_FILENAME cannot be transformed to a PGM string on Arduino and it breaks building
#define BUG_ON(V...) do { SERIAL_ECHO(ONLY_FILENAME); SERIAL_ECHO(__LINE__); SERIAL_ECHOLN(": "); SERIAL_ECHOLNPAIR(V); SERIAL_FLUSHTX(); *(char*)0 = 42; } while(0) #define BUG_ON(V...) do { SERIAL_ECHO(ONLY_FILENAME); SERIAL_ECHO(__LINE__); SERIAL_ECHOLNPGM(": "); SERIAL_ECHOLNPAIR(V); SERIAL_FLUSHTX(); *(char*)0 = 42; } while(0)
#elif ENABLED(MARLIN_DEV_MODE) #elif ENABLED(MARLIN_DEV_MODE)
// Don't stop the CPU here, but at least dump the bug on the serial port // Don't stop the CPU here, but at least dump the bug on the serial port
// \/ Don't replace by SERIAL_ECHOPAIR since ONLY_FILENAME cannot be transformed to a PGM string on Arduino and it breaks building // \/ Don't replace by SERIAL_ECHOPAIR since ONLY_FILENAME cannot be transformed to a PGM string on Arduino and it breaks building
#define BUG_ON(V...) do { SERIAL_ECHO(ONLY_FILENAME); SERIAL_ECHO(__LINE__); SERIAL_ECHOLN(": BUG!"); SERIAL_ECHOLNPAIR(V); SERIAL_FLUSHTX(); } while(0) #define BUG_ON(V...) do { SERIAL_ECHO(ONLY_FILENAME); SERIAL_ECHO(__LINE__); SERIAL_ECHOLNPGM(": BUG!"); SERIAL_ECHOLNPAIR(V); SERIAL_FLUSHTX(); } while(0)
#else #else
// Release mode, let's ignore the bug // Release mode, let's ignore the bug
#define BUG_ON(V...) NOOP #define BUG_ON(V...) NOOP

View file

@ -88,7 +88,7 @@ static const uint8_t u8g_dev_ssd13xx_sleep_off[] PROGMEM = {
}; };
uint8_t u8g_dev_ssd1309_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) { uint8_t u8g_dev_ssd1309_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) {
switch(msg) { switch (msg) {
case U8G_DEV_MSG_INIT: case U8G_DEV_MSG_INIT:
u8g_InitCom(u8g, dev, U8G_SPI_CLK_CYCLE_300NS); u8g_InitCom(u8g, dev, U8G_SPI_CLK_CYCLE_300NS);
u8g_WriteEscSeqP(u8g, dev, u8g_dev_ssd1309_128x64_init_seq); u8g_WriteEscSeqP(u8g, dev, u8g_dev_ssd1309_128x64_init_seq);

View file

@ -35,22 +35,27 @@
using namespace ExtUI; using namespace ExtUI;
namespace Anycubic { namespace Anycubic {
class FileNavigator {
public: class FileNavigator {
FileNavigator(); public:
void reset(); FileNavigator();
void getFiles(uint16_t); void reset();
void upDIR(); void getFiles(uint16_t, panel_type_t, uint8_t filesneeded=4);
void changeDIR(char *); void upDIR();
void sendFile(); void changeDIR(const char *);
void refresh(); void sendFile(panel_type_t);
char * getCurrentFolderName(); void refresh();
private: void skiptofileindex(uint16_t);
static FileList filelist;
static char currentfoldername[MAX_PATH_LEN]; static FileList filelist;
static uint16_t lastindex; private:
static uint8_t folderdepth; static uint16_t lastpanelindex;
static uint16_t currentindex; static uint16_t currentindex;
}; static uint8_t currentfolderdepth;
extern FileNavigator filenavigator; static uint16_t currentfolderindex[MAX_FOLDER_DEPTH];
static char currentfoldername[MAX_PATH_LEN];
};
extern FileNavigator filenavigator;
} }

File diff suppressed because it is too large Load diff

View file

@ -35,46 +35,46 @@
namespace Anycubic { namespace Anycubic {
class ChironTFT { class ChironTFT {
private: private:
static printer_state_t printer_state; static printer_state_t printer_state;
static paused_state_t pause_state; static paused_state_t pause_state;
static heater_state_t hotend_state; static heater_state_t hotend_state;
static heater_state_t hotbed_state; static heater_state_t hotbed_state;
static xy_uint8_t selectedmeshpoint; static xy_uint8_t selectedmeshpoint;
static char panel_command[MAX_CMND_LEN]; static char panel_command[MAX_CMND_LEN];
static uint8_t command_len; static uint8_t command_len;
static char selectedfile[MAX_PATH_LEN]; static char selectedfile[MAX_PATH_LEN];
static float live_Zoffset; static float live_Zoffset;
static file_menu_t file_menu; static file_menu_t file_menu;
public: public:
ChironTFT(); ChironTFT();
static void Startup(); static void Startup();
static void IdleLoop(); static void IdleLoop();
static void PrinterKilled(PGM_P,PGM_P); static void PrinterKilled(PGM_P,PGM_P);
static void MediaEvent(media_event_t); static void MediaEvent(media_event_t);
static void TimerEvent(timer_event_t); static void TimerEvent(timer_event_t);
static void FilamentRunout(); static void FilamentRunout();
static void ConfirmationRequest(const char * const ); static void ConfirmationRequest(const char * const );
static void StatusChange(const char * const ); static void StatusChange(const char * const );
static void PowerLossRecovery(); static void PowerLossRecovery();
private: private:
static void SendtoTFT(PGM_P); static void SendtoTFT(PGM_P);
static void SendtoTFTLN(PGM_P); static void SendtoTFTLN(PGM_P);
static bool ReadTFTCommand(); static bool ReadTFTCommand();
static int8_t Findcmndpos(const char *, char); static int8_t Findcmndpos(const char *, char);
static void CheckHeaters(); static void CheckHeaters();
static void SendFileList(int8_t); static void SendFileList(int8_t);
static void SelectFile(); static void SelectFile();
static void InjectCommandandWait(PGM_P); static void InjectCommandandWait(PGM_P);
static void ProcessPanelRequest(); static void ProcessPanelRequest();
static void PanelInfo(uint8_t); static void PanelInfo(uint8_t);
static void PanelAction(uint8_t); static void PanelAction(uint8_t);
static void PanelProcess(uint8_t); static void PanelProcess(uint8_t);
}; };
extern ChironTFT Chiron; extern ChironTFT Chiron;
} // Anycubic } // Anycubic

View file

@ -109,19 +109,16 @@
#define AC_cmnd_power_loss_recovery PSTR("G28XYR5\nG28Z") // Lift, home X and Y then home Z when in 'safe' position #define AC_cmnd_power_loss_recovery PSTR("G28XYR5\nG28Z") // Lift, home X and Y then home Z when in 'safe' position
namespace Anycubic { namespace Anycubic {
enum heater_state_t : uint8_t { enum heater_state_t : uint8_t {
AC_heater_off, AC_heater_off,
AC_heater_temp_set, AC_heater_temp_set,
AC_heater_temp_reached AC_heater_temp_reached
}; };
enum paused_state_t : uint8_t { enum paused_state_t : uint8_t {
AC_paused_heater_timed_out, AC_paused_heater_timed_out,
AC_paused_purging_filament, AC_paused_purging_filament,
AC_paused_idle AC_paused_idle
}; };
enum printer_state_t : uint8_t { enum printer_state_t : uint8_t {
AC_printer_idle, AC_printer_idle,
AC_printer_probing, AC_printer_probing,
@ -131,13 +128,11 @@ namespace Anycubic {
AC_printer_stopping, AC_printer_stopping,
AC_printer_resuming_from_power_outage AC_printer_resuming_from_power_outage
}; };
enum timer_event_t : uint8_t { enum timer_event_t : uint8_t {
AC_timer_started, AC_timer_started,
AC_timer_paused, AC_timer_paused,
AC_timer_stopped AC_timer_stopped
}; };
enum media_event_t : uint8_t { enum media_event_t : uint8_t {
AC_media_inserted, AC_media_inserted,
AC_media_removed, AC_media_removed,
@ -149,5 +144,4 @@ namespace Anycubic {
AC_menu_change_to_file, AC_menu_change_to_file,
AC_menu_change_to_command AC_menu_change_to_command
}; };
} // Anycubic } // Anycubic