Skip to content

Commit

Permalink
Fix 'missing braces around initializer' warning, fix compile error fo…
Browse files Browse the repository at this point in the history
…r TFT28_V3, Improvements to ListMode, Update precompiled binaries (bigtreetech#295)

Fix 'Missing braces warning' and compile error for TFT28_V3
Fix 'missing braces around initializer' warning due to which some other warning were overlooked by the compiler.
fix compile error for TFT28_V3
Improvements to ListMode - reducing screen flicker
show custom gcode in main menu in Unified Menu
Update precompiled binaries and firmware archive
  • Loading branch information
guruathwal authored and bigtreetech committed Jan 13, 2020
1 parent 9b36ce3 commit 4bb7a42
Show file tree
Hide file tree
Showing 55 changed files with 28 additions and 39 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
5 changes: 3 additions & 2 deletions TFT/src/User/Menu/Fan.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ void menuFan(void)
switch(key_num)
{
case KEY_ICON_0:
if (fanSpeed[curIndex] > 0)
#ifdef SHOW_FAN_PERCENTAGE
if (fanSpeed[curIndex] > 0) {
#ifdef SHOW_FAN_PERCENTAGE
if ((fanSpeed[curIndex]-2) > 0) {
fanSpeed[curIndex]-=2; //2.55 is 1 percent, rounding down
} else {
Expand All @@ -107,6 +107,7 @@ void menuFan(void)
#else
fanSpeed[curIndex]--;
#endif
}
break;

case KEY_ICON_3:
Expand Down
19 changes: 3 additions & 16 deletions TFT/src/User/Menu/FeatureSettings.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,30 +294,26 @@
case SKEY_HIDEACK:
infoSettings.terminalACK = (infoSettings.terminalACK + 1) % 2;
settingPage[item_index].icon = toggleitem[infoSettings.terminalACK];
featureSettingsItems.items[key_val].icon = toggleitem[infoSettings.terminalACK];;
menuDrawListItem(&featureSettingsItems.items[key_val], key_val);
featureSettingsItems.items[key_val].icon = toggleitem[infoSettings.terminalACK];
break;

case SKEY_INVERT_Y:
infoSettings.invert_yaxis = (infoSettings.invert_yaxis + 1) % 2;
settingPage[item_index].icon = toggleitem[infoSettings.invert_yaxis];
featureSettingsItems.items[key_val] = settingPage[item_index];
menuDrawListItem(&featureSettingsItems.items[key_val], key_val);
break;

case SKEY_INVERT_Z:
infoSettings.invert_zaxis = (infoSettings.invert_zaxis + 1) % 2;
settingPage[item_index].icon = toggleitem[infoSettings.invert_zaxis];
featureSettingsItems.items[key_val] = settingPage[item_index];
menuDrawListItem(&featureSettingsItems.items[key_val], key_val);
break;

#ifdef PS_ON_PIN
case SKEY_POWER:
item_power_off_i = (item_power_off_i + 1) % ITEM_PS_ON_NUM;
settingPage[item_index] = itemPowerOff[item_power_off_i];
featureSettingsItems.items[key_val] = settingPage[item_index];
menuDrawListItem(&featureSettingsItems.items[key_val], key_val);
infoSettings.auto_off = item_power_off[item_power_off_i];
break;
#endif
Expand All @@ -327,7 +323,6 @@
item_runout_i = (item_runout_i + 1) % ITEM_RUNOUT_NUM;
settingPage[item_index] = itemRunout[item_runout_i];
featureSettingsItems.items[key_val] = settingPage[item_index];
menuDrawListItem(&featureSettingsItems.items[key_val], key_val);
infoSettings.runout = item_runout[item_runout_i];
break;
#endif
Expand All @@ -336,15 +331,13 @@
infoSettings.move_speed = (infoSettings.move_speed + 1) % ITEM_SPEED_NUM;
settingPage[item_index] = itemMoveSpeed[infoSettings.move_speed];
featureSettingsItems.items[key_val] = settingPage[item_index];
menuDrawListItem(&featureSettingsItems.items[key_val], key_val);
break;

#ifdef LED_color_PIN
case SKEY_KNOB:
infoSettings.led_color = (infoSettings.led_color + 1) % LED_color_NUM;
settingPage[item_index] = itemLedcolor[infoSettings.led_color];
featureSettingsItems.items[key_val] = settingPage[item_index];
menuDrawListItem(&featureSettingsItems.items[key_val], key_val);
ws2812_send_DAT(led_color[infoSettings.led_color]);
break;
#endif
Expand Down Expand Up @@ -447,12 +440,6 @@

}

void refreshItemsDisplay(){
for (uint8_t i = 0; i < ITEM_PER_PAGE; i++)
{
menuDrawListItem(&featureSettingsItems.items[i],i);
}
}

void menuFeatureSettings(void)
{
Expand All @@ -472,7 +459,7 @@
if (fe_cur_page > 0){
fe_cur_page--;
loadFeatureSettings();
refreshItemsDisplay();
menuRefreshListPage();
}
}
break;
Expand All @@ -482,7 +469,7 @@
if (fe_cur_page < FE_PAGE_COUNT - 1){
fe_cur_page++;
loadFeatureSettings();
refreshItemsDisplay();
menuRefreshListPage();
}
}
break;
Expand Down
9 changes: 4 additions & 5 deletions TFT/src/User/Menu/MachineSettings.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ void menuCustom(void)
customItems.items[i].icon = ICONCHAR_BACKGROUND;
customItems.items[i].titlelabel.index = LABEL_BACKGROUND;
}
menuDrawListItem(&customItems.items[i],i);
}
// set page up down button according to page count and current page
if (CKEY_COUNT <= LISTITEM_PER_PAGE)
Expand All @@ -272,8 +271,8 @@ void menuCustom(void)
customItems.items[6].icon = ICONCHAR_PAGEDOWN;
}
}
menuDrawListItem(&customItems.items[5],5);
menuDrawListItem(&customItems.items[6],6);
// menuDrawListItem(&customItems.items[5],5);
//menuDrawListItem(&customItems.items[6],6);
}

void menuCustom(void)
Expand All @@ -296,15 +295,15 @@ void menuCustom(void)
if(GC_PAGE_COUNT > 1){
if (gc_cur_page > 0){
gc_cur_page--;
loaditemsCustomGcode();
menuRefreshListPage();
}
}
break;
case KEY_ICON_6:
if(GC_PAGE_COUNT > 1){
if (gc_cur_page < GC_PAGE_COUNT-1){
gc_cur_page++;
loaditemsCustomGcode();
menuRefreshListPage();
}
}
break;
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/Menu/MachineSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@

void menuRGBSettings(void);
void menuMachineSettings(void);
void menuCustom(void);

#endif
14 changes: 7 additions & 7 deletions TFT/src/User/Menu/MainPage.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ LABEL_READY,
{{ICON_HEAT_FAN, lABEL_UNIFIEDHEAT},
{ICON_HOME_MOVE, LABEL_UNIFIEDMOVE},
{ICON_EXTRUDE, LABEL_EXTRUDE},
{ICON_PRINT, LABEL_PRINT},
{ICON_GCODE, LABEL_GCODE},
{ICON_STOP, LABEL_EMERGENCYSTOP},
{ICON_GCODE, LABEL_GCODE},
{ICON_CUSTOM, LABEL_CUSTOM},
{ICON_SETTINGS, LABEL_SETTINGS},
{ICON_BACK, LABEL_BACK},}
{ICON_BACK, LABEL_BACK}}
#else
{{ICON_HEAT, LABEL_PREHEAT},
{ICON_MOVE, LABEL_MOVE},
Expand All @@ -23,7 +23,7 @@ LABEL_READY,
{ICON_EXTRUDE, LABEL_EXTRUDE},
{ICON_SETTINGS, LABEL_SETTINGS},
{ICON_BACKGROUND, LABEL_BACKGROUND},
{ICON_BACK, LABEL_BACK},}
{ICON_BACK, LABEL_BACK}}
#endif
};

Expand All @@ -42,11 +42,11 @@ void menuMain(void)
case KEY_ICON_0: infoMenu.menu[++infoMenu.cur] = menuUnifiedHeat; break;
case KEY_ICON_1: infoMenu.menu[++infoMenu.cur] = menuUnifiedMove; break;
case KEY_ICON_2: infoMenu.menu[++infoMenu.cur] = menuExtrude; break;
case KEY_ICON_3: infoMenu.menu[++infoMenu.cur] = menuPrint; break;
case KEY_ICON_4: infoMenu.menu[++infoMenu.cur] = menuSendGcode; break;
case KEY_ICON_5: { storeCmd("M112\n");} break; // Emergency Stop : Used for emergency stopping, a reset is required to return to operational mode.
case KEY_ICON_3: { storeCmd("M112\n");} break; // Emergency Stop : Used for emergency stopping, a reset is required to return to operational mode.
// it may need to wait for a space to open up in the command queue.
// Enable EMERGENCY_PARSER in Marlin Firmware for an instantaneous M112 command.
case KEY_ICON_4: infoMenu.menu[++infoMenu.cur] = menuSendGcode; break;
case KEY_ICON_5: infoMenu.menu[++infoMenu.cur] = menuCustom ; break;
case KEY_ICON_6: infoMenu.menu[++infoMenu.cur] = menuSettings; break;
case KEY_ICON_7: infoMenu.cur--; break;
default:break;
Expand Down
6 changes: 0 additions & 6 deletions TFT/src/User/Menu/Move.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,6 @@ static u32 update_time = 50; // 1 seconds is 100
void menuMove(void)
{
KEY_VALUES key_num = KEY_IDLE;
uint32_t B0;
uint32_t B1;
uint32_t B2;
uint32_t B5;
uint32_t B6;
uint32_t B7;


#ifdef ALTERNATIVE_MOVE_MENU
Expand Down
1 change: 0 additions & 1 deletion TFT/src/User/Menu/Parametersetting.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@ void parametersetting(void)
void temp_Change(void)
{
//static FP_MENU NUM[MAX_MENU_DEPTH];
char tempstr[10];
static int16_t compare [2];

if(infoHost.connected == false || infoMenu.menu[infoMenu.cur] == menuPrinting) return;
Expand Down
2 changes: 1 addition & 1 deletion TFT/src/User/Menu/StatusScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void gantry_inc(int n, float val);
#define STATUS_GANTRY_YOFFSET 6


#elif defined(TFT28_V1_0) || defined(TFT24_V1_1)
#elif defined(TFT28_V1_0) || defined(TFT24_V1_1) || defined(TFT28_V3_0)

#define SSICON_VAL_Y0 47
//#define statusicon_val_charcount 7
Expand Down
8 changes: 7 additions & 1 deletion TFT/src/User/Menu/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ void menuDrawItem(const ITEM *item, uint8_t positon)

void menuDrawIconOnly(const ITEM *item, uint8_t positon)
{
uint8_t *content = labelGetAddress(&item->label);
const GUI_RECT *rect = rect_of_key + positon;
if(item->icon != ICON_BACKGROUND)
ICON_ReadDisplay(rect->x0, rect->y0, item->icon);
Expand All @@ -120,6 +119,13 @@ void menuDrawIconOnly(const ITEM *item, uint8_t positon)
ListItem_Display(rect, position, item, false);
}
}
void menuRefreshListPage(void){
for (uint8_t i = 0; i < ITEM_PER_PAGE; i++)
{
menuDrawListItem(&curListItems->items[i], i);
}

}

static REMINDER reminder = {{0, 0, LCD_WIDTH, TITLE_END_Y}, 0, STATUS_UNCONNECT, LABEL_UNCONNECTED};
static REMINDER volumeReminder = {{0, 0, LCD_WIDTH, TITLE_END_Y}, 0, STATUS_IDLE, LABEL_BACKGROUND};
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/Menu/menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ void GUI_RestoreColorDefault(void);
void menuDrawItem (const ITEM * menuItem, uint8_t positon);
void menuDrawIconOnly(const ITEM *item, uint8_t positon);
void menuDrawListItem(const LISTITEM *item, uint8_t positon);
void menuRefreshListPage(void);
void menuDrawTitle(const uint8_t *content); //(const MENUITEMS * menuItems);
void menuDrawPage (const MENUITEMS * menuItems);
void menuDrawListPage(const LISTITEMS *listItems);
Expand Down
1 change: 1 addition & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ default_src_filter = +<src/*> -<src/Libraries> -<src/User/Hal/stm32f10x> -<src/U
build_flags = -fmax-errors=5
-g
-ggdb
-Wno-missing-braces
-DUSE_STDPERIPH_DRIVER=
-D__STATIC_INLINE=
-ITFT/src/Libraries/cmsis/Core-CM3
Expand Down

0 comments on commit 4bb7a42

Please sign in to comment.