瀏覽代碼

Misc. formatting, serial out

Scott Lahteine 3 年之前
父節點
當前提交
0e9836649e

+ 4
- 4
Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp 查看文件

320
     // 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
320
     // 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
321
     // probably break if the flash happens to be more than 128MB, but in this case, we are not magician, we need help from outside.
321
     // probably break if the flash happens to be more than 128MB, but in this case, we are not magician, we need help from outside.
322
 
322
 
323
-    unsigned long * vecAddr = (unsigned long*)get_vtor();
324
-    SERIAL_ECHO("Vector table addr: ");
323
+    unsigned long *vecAddr = (unsigned long*)get_vtor();
324
+    SERIAL_ECHOPGM("Vector table addr: ");
325
     SERIAL_PRINTLN(get_vtor(), HEX);
325
     SERIAL_PRINTLN(get_vtor(), HEX);
326
 
326
 
327
     #ifdef VECTOR_TABLE_SIZE
327
     #ifdef VECTOR_TABLE_SIZE
348
       // 128 bytes alignement is required for writing the VTOR register
348
       // 128 bytes alignement is required for writing the VTOR register
349
       alignas(128) static unsigned long vectable[VECTOR_TABLE_SENTINEL];
349
       alignas(128) static unsigned long vectable[VECTOR_TABLE_SENTINEL];
350
 
350
 
351
-      SERIAL_ECHO("Detected vector table size: ");
351
+      SERIAL_ECHOPGM("Detected vector table size: ");
352
       SERIAL_PRINTLN(vec_size, HEX);
352
       SERIAL_PRINTLN(vec_size, HEX);
353
     #endif
353
     #endif
354
 
354
 
372
 
372
 
373
     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)
373
     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)
374
 
374
 
375
-    SERIAL_ECHOLN("Installed fault handlers");
375
+    SERIAL_ECHOLNPGM("Installed fault handlers");
376
   #endif
376
   #endif
377
 }
377
 }
378
 
378
 

+ 2
- 2
Marlin/src/core/bug_on.h 查看文件

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

+ 1
- 1
Marlin/src/lcd/dogm/u8g_dev_ssd1309_12864.cpp 查看文件

88
 };
88
 };
89
 
89
 
90
 uint8_t u8g_dev_ssd1309_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) {
90
 uint8_t u8g_dev_ssd1309_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) {
91
-  switch(msg) {
91
+  switch (msg) {
92
     case U8G_DEV_MSG_INIT:
92
     case U8G_DEV_MSG_INIT:
93
       u8g_InitCom(u8g, dev, U8G_SPI_CLK_CYCLE_300NS);
93
       u8g_InitCom(u8g, dev, U8G_SPI_CLK_CYCLE_300NS);
94
       u8g_WriteEscSeqP(u8g, dev, u8g_dev_ssd1309_128x64_init_seq);
94
       u8g_WriteEscSeqP(u8g, dev, u8g_dev_ssd1309_128x64_init_seq);

+ 23
- 18
Marlin/src/lcd/extui/lib/anycubic_chiron/FileNavigator.h 查看文件

35
 using namespace ExtUI;
35
 using namespace ExtUI;
36
 
36
 
37
 namespace Anycubic {
37
 namespace Anycubic {
38
-  class FileNavigator {
39
-    public:
40
-      FileNavigator();
41
-      void   reset();
42
-      void   getFiles(uint16_t);
43
-      void   upDIR();
44
-      void   changeDIR(char *);
45
-      void   sendFile();
46
-      void   refresh();
47
-      char * getCurrentFolderName();
48
-    private:
49
-      static FileList  filelist;
50
-      static char      currentfoldername[MAX_PATH_LEN];
51
-      static uint16_t  lastindex;
52
-      static uint8_t   folderdepth;
53
-      static uint16_t  currentindex;
54
-  };
55
-  extern FileNavigator filenavigator;
38
+
39
+class FileNavigator {
40
+  public:
41
+    FileNavigator();
42
+    void reset();
43
+    void getFiles(uint16_t, panel_type_t, uint8_t filesneeded=4);
44
+    void upDIR();
45
+    void changeDIR(const char *);
46
+    void sendFile(panel_type_t);
47
+    void refresh();
48
+    void skiptofileindex(uint16_t);
49
+
50
+    static FileList filelist;
51
+  private:
52
+    static uint16_t lastpanelindex;
53
+    static uint16_t currentindex;
54
+    static uint8_t  currentfolderdepth;
55
+    static uint16_t currentfolderindex[MAX_FOLDER_DEPTH];
56
+    static char     currentfoldername[MAX_PATH_LEN];
57
+};
58
+
59
+extern FileNavigator filenavigator;
60
+
56
 }
61
 }

+ 747
- 747
Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp
文件差異過大導致無法顯示
查看文件


+ 38
- 38
Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.h 查看文件

35
 
35
 
36
 namespace Anycubic {
36
 namespace Anycubic {
37
 
37
 
38
-  class ChironTFT {
39
-    private:
40
-      static printer_state_t  printer_state;
41
-      static paused_state_t   pause_state;
42
-      static heater_state_t   hotend_state;
43
-      static heater_state_t   hotbed_state;
44
-      static xy_uint8_t       selectedmeshpoint;
45
-      static char             panel_command[MAX_CMND_LEN];
46
-      static uint8_t          command_len;
47
-      static char             selectedfile[MAX_PATH_LEN];
48
-      static float            live_Zoffset;
49
-      static file_menu_t      file_menu;
38
+class ChironTFT {
39
+  private:
40
+    static printer_state_t  printer_state;
41
+    static paused_state_t   pause_state;
42
+    static heater_state_t   hotend_state;
43
+    static heater_state_t   hotbed_state;
44
+    static xy_uint8_t       selectedmeshpoint;
45
+    static char             panel_command[MAX_CMND_LEN];
46
+    static uint8_t          command_len;
47
+    static char             selectedfile[MAX_PATH_LEN];
48
+    static float            live_Zoffset;
49
+    static file_menu_t      file_menu;
50
 
50
 
51
-    public:
52
-      ChironTFT();
53
-      static void Startup();
54
-      static void IdleLoop();
55
-      static void PrinterKilled(PGM_P,PGM_P);
56
-      static void MediaEvent(media_event_t);
57
-      static void TimerEvent(timer_event_t);
58
-      static void FilamentRunout();
59
-      static void ConfirmationRequest(const char * const );
60
-      static void StatusChange(const char * const );
61
-      static void PowerLossRecovery();
51
+  public:
52
+    ChironTFT();
53
+    static void Startup();
54
+    static void IdleLoop();
55
+    static void PrinterKilled(PGM_P,PGM_P);
56
+    static void MediaEvent(media_event_t);
57
+    static void TimerEvent(timer_event_t);
58
+    static void FilamentRunout();
59
+    static void ConfirmationRequest(const char * const );
60
+    static void StatusChange(const char * const );
61
+    static void PowerLossRecovery();
62
 
62
 
63
-    private:
64
-      static void SendtoTFT(PGM_P);
65
-      static void SendtoTFTLN(PGM_P);
66
-      static bool ReadTFTCommand();
67
-      static int8_t Findcmndpos(const char *, char);
68
-      static void CheckHeaters();
69
-      static void SendFileList(int8_t);
70
-      static void SelectFile();
71
-      static void InjectCommandandWait(PGM_P);
72
-      static void ProcessPanelRequest();
73
-      static void PanelInfo(uint8_t);
74
-      static void PanelAction(uint8_t);
75
-      static void PanelProcess(uint8_t);
76
-  };
63
+  private:
64
+    static void SendtoTFT(PGM_P);
65
+    static void SendtoTFTLN(PGM_P);
66
+    static bool ReadTFTCommand();
67
+    static int8_t Findcmndpos(const char *, char);
68
+    static void CheckHeaters();
69
+    static void SendFileList(int8_t);
70
+    static void SelectFile();
71
+    static void InjectCommandandWait(PGM_P);
72
+    static void ProcessPanelRequest();
73
+    static void PanelInfo(uint8_t);
74
+    static void PanelAction(uint8_t);
75
+    static void PanelProcess(uint8_t);
76
+};
77
 
77
 
78
-  extern ChironTFT Chiron;
78
+extern ChironTFT Chiron;
79
 
79
 
80
 } // Anycubic
80
 } // Anycubic

+ 0
- 6
Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft_defs.h 查看文件

109
 #define AC_cmnd_power_loss_recovery    PSTR("G28XYR5\nG28Z")           // Lift, home X and Y then home Z when in 'safe' position
109
 #define AC_cmnd_power_loss_recovery    PSTR("G28XYR5\nG28Z")           // Lift, home X and Y then home Z when in 'safe' position
110
 
110
 
111
 namespace Anycubic {
111
 namespace Anycubic {
112
-
113
   enum heater_state_t : uint8_t {
112
   enum heater_state_t : uint8_t {
114
     AC_heater_off,
113
     AC_heater_off,
115
     AC_heater_temp_set,
114
     AC_heater_temp_set,
116
     AC_heater_temp_reached
115
     AC_heater_temp_reached
117
   };
116
   };
118
-
119
   enum paused_state_t : uint8_t {
117
   enum paused_state_t : uint8_t {
120
     AC_paused_heater_timed_out,
118
     AC_paused_heater_timed_out,
121
     AC_paused_purging_filament,
119
     AC_paused_purging_filament,
122
     AC_paused_idle
120
     AC_paused_idle
123
   };
121
   };
124
-
125
   enum printer_state_t : uint8_t {
122
   enum printer_state_t : uint8_t {
126
     AC_printer_idle,
123
     AC_printer_idle,
127
     AC_printer_probing,
124
     AC_printer_probing,
131
     AC_printer_stopping,
128
     AC_printer_stopping,
132
     AC_printer_resuming_from_power_outage
129
     AC_printer_resuming_from_power_outage
133
   };
130
   };
134
-
135
   enum timer_event_t : uint8_t {
131
   enum timer_event_t : uint8_t {
136
     AC_timer_started,
132
     AC_timer_started,
137
     AC_timer_paused,
133
     AC_timer_paused,
138
     AC_timer_stopped
134
     AC_timer_stopped
139
   };
135
   };
140
-
141
   enum media_event_t : uint8_t {
136
   enum media_event_t : uint8_t {
142
     AC_media_inserted,
137
     AC_media_inserted,
143
     AC_media_removed,
138
     AC_media_removed,
149
     AC_menu_change_to_file,
144
     AC_menu_change_to_file,
150
     AC_menu_change_to_command
145
     AC_menu_change_to_command
151
   };
146
   };
152
-
153
 } // Anycubic
147
 } // Anycubic

Loading…
取消
儲存