Skip to content

Commit

Permalink
Change ENC_ACTIVE_SIGNAL logic to disable encoder in Marlin firmware …
Browse files Browse the repository at this point in the history
…when TFT is not in Marlin mode. (bigtreetech#1203)
  • Loading branch information
guruathwal authored and Manu512 committed Nov 3, 2020
1 parent e589a03 commit e86d847
Show file tree
Hide file tree
Showing 12 changed files with 182 additions and 108 deletions.
40 changes: 40 additions & 0 deletions .github/lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#
# Configuration for Lock Threads - https://github.com/dessant/lock-threads-app
#

# Number of days of inactivity before a closed issue or pull request is locked
daysUntilLock: 90

# Skip issues and pull requests created before a given timestamp. Timestamp must
# follow ISO 8601 (`YYYY-MM-DD`). Set to `false` to disable
skipCreatedBefore: false

# Issues and pull requests with these labels will be ignored. Set to `[]` to disable
exemptLabels: [ 'no-locking' ]

# Label to add before locking, such as `outdated`. Set to `false` to disable
lockLabel: false

# Comment to post before locking. Set to `false` to disable
lockComment: >
This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.
# Assign `resolved` as the reason for locking. Set to `false` to disable
setLockReason: true

# Limit to only `issues` or `pulls`
# only: issues

# Optionally, specify configuration settings just for `issues` or `pulls`
# issues:
# exemptLabels:
# - help-wanted
# lockLabel: outdated

# pulls:
# daysUntilLock: 30

# Repository to extend settings from
# _extends: repo
61 changes: 61 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Configuration for probot-stale - https://github.com/probot/stale

# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 60

# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
daysUntilClose: 7

# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
onlyLabels: []

# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
exemptLabels:
- pinned
- security
- "[Status] Maybe Later"

# Set to true to ignore issues in a project (defaults to false)
exemptProjects: false

# Set to true to ignore issues in a milestone (defaults to false)
exemptMilestones: false

# Set to true to ignore issues with an assignee (defaults to false)
exemptAssignees: false

# Label to use when marking as stale
staleLabel: Abandoned

# Comment to post when marking as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when removing the stale label.
# unmarkComment: >
# Your comment here.

# Comment to post when closing a stale Issue or Pull Request.
# closeComment: >
# Your comment here.

# Limit the number of actions per hour, from 1-30. Default is 30
limitPerRun: 30

# Limit to only `issues` or `pulls`
# only: issues

# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
# pulls:
# daysUntilStale: 30
# markComment: >
# This pull request has been automatically marked as stale because it has not had
# recent activity. It will be closed if no further activity occurs. Thank you
# for your contributions.

# issues:
# exemptLabels:
# - confirmed
12 changes: 1 addition & 11 deletions TFT/src/User/API/BabystepControl.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ static float babystep_value = BABYSTEP_DEFAULT_VALUE;
float babystepReset(void)
{
babystep_value = BABYSTEP_DEFAULT_VALUE;

return babystep_value;
}

Expand All @@ -28,22 +27,19 @@ float babystepResetValue(void)
float processed_baby_step = 0.0f;
int8_t neg = 1;

if (babystep_value < 0.0f)
neg = -1;
if (babystep_value < 0.0f) neg = -1;

step_count = (babystep_value * neg) / BABYSTEP_MAX_UNIT;
for (; step_count > 0; step_count--)
{
mustStoreCmd("M290 Z%.2f\n", -(BABYSTEP_MAX_UNIT * neg));

processed_baby_step += BABYSTEP_MAX_UNIT;
}

last_unit = (babystep_value * neg) - processed_baby_step;
if (last_unit > 0.0f)
{
mustStoreCmd("M290 Z%.2f\n", -(last_unit * neg));

processed_baby_step += last_unit;
}

Expand All @@ -58,11 +54,8 @@ float babystepDecreaseValue(float unit)
if (babystep_value > BABYSTEP_MIN_VALUE)
{
float diff = babystep_value - BABYSTEP_MIN_VALUE;

unit = (diff > unit) ? unit : diff;

mustStoreCmd("M290 Z-%.2f\n", unit);

babystep_value -= unit;
}

Expand All @@ -75,11 +68,8 @@ float babystepIncreaseValue(float unit)
if (babystep_value < BABYSTEP_MAX_VALUE)
{
float diff = BABYSTEP_MAX_VALUE - babystep_value;

unit = (diff > unit) ? unit : diff;

mustStoreCmd("M290 Z%.2f\n", unit);

babystep_value += unit;
}

Expand Down
2 changes: 1 addition & 1 deletion TFT/src/User/API/LCD_Encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void HW_EncoderInit(void)
void HW_EncActiveSignalInit(void)
{
GPIO_InitSet(LCD_ENC_EN_PIN, MGPIO_MODE_OUT_PP, 0);
setEncActiveSignal(1);
setEncActiveSignal(0);
}

void setEncActiveSignal(uint8_t status)
Expand Down
32 changes: 11 additions & 21 deletions TFT/src/User/API/Settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,27 +166,17 @@ void initMachineSetting(void){

void setupMachine(void)
{
switch (ENABLE_BL_VALUE)
{
case 2:
infoMachineSettings.leveling = BL_ABL;
break;

case 3:
infoMachineSettings.leveling = BL_BBL;
break;

case 4:
infoMachineSettings.leveling = BL_UBL;
break;

case 5:
infoMachineSettings.leveling = BL_MBL;
break;

default:
break;
}
#ifdef ENABLE_BL_VALUE
#if ENABLE_BL_VALUE == 2
infoMachineSettings.leveling = BL_ABL;
#elif ENABLE_BL_VALUE == 3
infoMachineSettings.leveling = BL_BBL;
#elif ENABLE_BL_VALUE == 4
infoMachineSettings.leveling = BL_UBL;
#elif ENABLE_BL_VALUE == 5
infoMachineSettings.leveling = BL_MBL;
#endif
#endif

if (infoMachineSettings.leveling != BL_DISABLED && infoMachineSettings.EEPROM == 1 && infoSettings.auto_load_leveling == 1)
{
Expand Down
29 changes: 15 additions & 14 deletions TFT/src/User/API/interfaceCmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -814,22 +814,23 @@ void sendQueueCmd(void)
storeCmd("M503 S0\n");
break;

case 29: //G29
if(ENABLE_BL_VALUE > 0) // if not Disabled
{
if(cmd_seen('A'))
{
setParameter(P_ABL_STATE,0,1);
storeCmd("M117 UBL active\n");
}
if(cmd_seen('D'))
#if ENABLE_BL_VALUE > 0 // if not Disabled
case 29: //G29
{
setParameter(P_ABL_STATE,0,0);
storeCmd("M117 UBL inactive\n");
if(cmd_seen('A'))
{
setParameter(P_ABL_STATE,0,1);
storeCmd("M117 UBL active\n");
}
if(cmd_seen('D'))
{
setParameter(P_ABL_STATE,0,0);
storeCmd("M117 UBL inactive\n");
}
}
}
break;

break;
#endif
case 90: //G90
coorSetRelative(false);
break;
Expand Down
16 changes: 6 additions & 10 deletions TFT/src/User/API/parseACK.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ void ackPopupInfo(const char *info)
}
}


void setIgnoreEcho(ECHO_ID msgId, bool state)
{
forceIgnore[msgId] = state;
Expand Down Expand Up @@ -553,18 +552,15 @@ void parseACK(void)
setDualStepperStatus(E_STEPPER, true);
}
// Parse and store ABL type if auto-detect is enabled
else if (ack_seen("Auto Bed Leveling") && ENABLE_BL_VALUE == 1)
{
#if ENABLE_BL_VALUE == 1
else if (ack_seen("Auto Bed Leveling"))
infoMachineSettings.leveling = BL_ABL;
}
else if (ack_seen("Unified Bed Leveling") && ENABLE_BL_VALUE == 1)
{
else if (ack_seen("Unified Bed Leveling"))
infoMachineSettings.leveling = BL_UBL;
}
else if (ack_seen("Mesh Bed Leveling") && ENABLE_BL_VALUE == 1)
{
else if (ack_seen("Mesh Bed Leveling"))
infoMachineSettings.leveling = BL_MBL;
}
#endif

// Parse ABL state
else if(ack_seen("echo:Bed Leveling"))
{
Expand Down
13 changes: 2 additions & 11 deletions TFT/src/User/Menu/Babystep.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,21 @@ const ITEM itemBabyStepUnit[ITEM_BABYSTEP_UNIT_NUM] = {
};

const float babystep_unit[ITEM_BABYSTEP_UNIT_NUM] = {0.01f, 0.1f, 1};
static u8 curUnit = 0;
static u8 curUnit = 0;

static float babystep;
static float orig_z_offset;

/* Initialize Z offset */
void babyInitZOffset(void)
{
float cur_z_offset = probeOffsetGetValue();

if (orig_z_offset + babystep != cur_z_offset)
{
orig_z_offset = cur_z_offset - babystep;
}
orig_z_offset = probeOffsetGetValue() - babystep;
}

/* Reset to default */
void babyReset(void)
{
babystepReset();

babyInitZOffset();
}

Expand Down Expand Up @@ -134,9 +128,7 @@ void menuBabystep(void)
// change step unit
case KEY_ICON_5:
curUnit = (curUnit + 1) % ITEM_BABYSTEP_UNIT_NUM;

babyStepItems.items[key_num] = itemBabyStepUnit[curUnit];

menuDrawItem(&babyStepItems.items[key_num], key_num);
break;

Expand All @@ -154,7 +146,6 @@ void menuBabystep(void)
if (encoderPosition)
{
babystep = babystepUpdateValueByEncoder(unit);

encoderPosition = 0;
}
#endif
Expand Down
1 change: 0 additions & 1 deletion TFT/src/User/Menu/Home.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "Home.h"
#include "includes.h"

//1��title(����), ITEM_PER_PAGE��item(ͼ��+��ǩ)
const MENUITEMS homeItems = {
// title
LABEL_HOME,
Expand Down
30 changes: 15 additions & 15 deletions TFT/src/User/Menu/Leveling.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
#include "Leveling.h"
#include "includes.h"

const MENUITEMS manualLevelingItems = {
// title
LABEL_LEVELING,
// icon label
{{ICON_POINT_1, LABEL_POINT_1},
{ICON_POINT_2, LABEL_POINT_2},
{ICON_POINT_3, LABEL_POINT_3},
{ICON_POINT_4, LABEL_POINT_4},
{ICON_POINT_5, LABEL_POINT_5},
{ICON_LEVEL_EDGE_DISTANCE, LABEL_DISTANCE},
{ICON_DISABLE_STEPPERS, LABEL_XY_UNLOCK},
{ICON_BACK, LABEL_BACK},}
};

void moveToLevelingPoint(u8 point)
{
s16 pointPosition[5][2] = {
Expand All @@ -23,22 +37,8 @@ void moveToLevelingPoint(u8 point)

void menuManualLeveling(void)
{
MENUITEMS manualLevelingItems = {
// title
LABEL_LEVELING,
// icon label
{{ICON_POINT_1, LABEL_POINT_1},
{ICON_POINT_2, LABEL_POINT_2},
{ICON_POINT_3, LABEL_POINT_3},
{ICON_POINT_4, LABEL_POINT_4},
{ICON_POINT_5, LABEL_POINT_5},
{ICON_LEVEL_EDGE_DISTANCE, LABEL_DISTANCE},
{ICON_DISABLE_STEPPERS, LABEL_XY_UNLOCK},
{ICON_BACK, LABEL_BACK},}
};

KEY_VALUES key_num = KEY_IDLE;

menuDrawPage(&manualLevelingItems);

while (infoMenu.menu[infoMenu.cur] == menuManualLeveling)
Expand Down
Loading

0 comments on commit e86d847

Please sign in to comment.