Browse Source

Misc. formatting, serial out

vanilla_fb_2.0.x
Scott Lahteine 4 years ago
committed by Scott Lahteine
parent
commit
326b1c1225
  1. 8
      Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp
  2. 4
      Marlin/src/core/bug_on.h
  3. 2
      Marlin/src/lcd/dogm/u8g_dev_ssd1309_12864.cpp
  4. 41
      Marlin/src/lcd/extui/lib/anycubic_chiron/FileNavigator.h
  5. 1494
      Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp
  6. 76
      Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.h
  7. 6
      Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft_defs.h

8
Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp

@ -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
// 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();
SERIAL_ECHO("Vector table addr: ");
unsigned long *vecAddr = (unsigned long*)get_vtor();
SERIAL_ECHOPGM("Vector table addr: ");
SERIAL_PRINTLN(get_vtor(), HEX);
#ifdef VECTOR_TABLE_SIZE
@ -348,7 +348,7 @@ void hook_cpu_exceptions() {
// 128 bytes alignement is required for writing the VTOR register
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);
#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)
SERIAL_ECHOLN("Installed fault handlers");
SERIAL_ECHOLNPGM("Installed fault handlers");
#endif
}

4
Marlin/src/core/bug_on.h

@ -28,11 +28,11 @@
// 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.
// \/ 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)
// 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
#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
// Release mode, let's ignore the bug
#define BUG_ON(V...) NOOP

2
Marlin/src/lcd/dogm/u8g_dev_ssd1309_12864.cpp

@ -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) {
switch(msg) {
switch (msg) {
case U8G_DEV_MSG_INIT:
u8g_InitCom(u8g, dev, U8G_SPI_CLK_CYCLE_300NS);
u8g_WriteEscSeqP(u8g, dev, u8g_dev_ssd1309_128x64_init_seq);

41
Marlin/src/lcd/extui/lib/anycubic_chiron/FileNavigator.h

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

1494
Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp

File diff suppressed because it is too large

76
Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.h

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

6
Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft_defs.h

@ -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
namespace Anycubic {
enum heater_state_t : uint8_t {
AC_heater_off,
AC_heater_temp_set,
AC_heater_temp_reached
};
enum paused_state_t : uint8_t {
AC_paused_heater_timed_out,
AC_paused_purging_filament,
AC_paused_idle
};
enum printer_state_t : uint8_t {
AC_printer_idle,
AC_printer_probing,
@ -131,13 +128,11 @@ namespace Anycubic {
AC_printer_stopping,
AC_printer_resuming_from_power_outage
};
enum timer_event_t : uint8_t {
AC_timer_started,
AC_timer_paused,
AC_timer_stopped
};
enum media_event_t : uint8_t {
AC_media_inserted,
AC_media_removed,
@ -149,5 +144,4 @@ namespace Anycubic {
AC_menu_change_to_file,
AC_menu_change_to_command
};
} // Anycubic

Loading…
Cancel
Save