Skip to content

Commit

Permalink
Merge pull request #325 from Paciente8159/modify-config-flow
Browse files Browse the repository at this point in the history
Modify config flow to support web config tool
  • Loading branch information
Paciente8159 committed Nov 1, 2022
2 parents 6dce7fb + fce3d99 commit b2ad799
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 14 deletions.
28 changes: 14 additions & 14 deletions uCNC/cnc_hal_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,26 +53,26 @@ extern "C"

// Uncomment to enable weak pull up resistors for limit switch
// If the pin is not defined in the board this will be ignored
#define LIMIT_X_PULLUP
#define LIMIT_Y_PULLUP
#define LIMIT_Z_PULLUP
#define LIMIT_X2_PULLUP
#define LIMIT_Y2_PULLUP
#define LIMIT_Z2_PULLUP
#define LIMIT_A_PULLUP
#define LIMIT_B_PULLUP
#define LIMIT_C_PULLUP
#define LIMIT_X_PULLUP_ENABLE
#define LIMIT_Y_PULLUP_ENABLE
#define LIMIT_Z_PULLUP_ENABLE
#define LIMIT_X2_PULLUP_ENABLE
#define LIMIT_Y2_PULLUP_ENABLE
#define LIMIT_Z2_PULLUP_ENABLE
#define LIMIT_A_PULLUP_ENABLE
#define LIMIT_B_PULLUP_ENABLE
#define LIMIT_C_PULLUP_ENABLE

// Uncomment to enable weak pull up resistor for probe
// If the pin is not defined in the board this will be ignored
// #define PROBE_PULLUP
// #define PROBE_PULLUP_ENABLE

// Uncomment to enable weak pull up resistors for control pins
// If the pin is not defined in the board this will be ignored
#define ESTOP_PULLUP
#define SAFETY_DOOR_PULLUP
#define FHOLD_PULLUP
#define CS_RES_PULLUP
#define ESTOP_PULLUP_ENABLE
#define SAFETY_DOOR_PULLUP_ENABLE
#define FHOLD_PULLUP_ENABLE
#define CS_RES_PULLUP_ENABLE

/**
* Uncomment this feature to enable tool length compensation
Expand Down
1 change: 1 addition & 0 deletions uCNC/src/cnc.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ extern "C"
#include "hal/tools/tool.h" //configures the kinematics for the cnc machine
// final HAL configurations
#include "../cnc_hal_config.h" //inicializes the HAL hardcoded connections
#include "cnc_hal_overrides.h" //config override file
// fill remaining HAL configurations and sanity checks
#include "cnc_hal_config_helper.h"
// initializes core utilities (like fast math functions)
Expand Down
45 changes: 45 additions & 0 deletions uCNC/src/cnc_hal_config_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,51 @@ extern "C"
#endif
#endif

#ifdef LIMIT_X_PULLUP_ENABLE
#define LIMIT_X_PULLUP
#endif
#ifdef LIMIT_Y_PULLUP_ENABLE
#define LIMIT_Y_PULLUP
#endif
#ifdef LIMIT_Z_PULLUP_ENABLE
#define LIMIT_Z_PULLUP
#endif
#ifdef LIMIT_X2_PULLUP_ENABLE
#define LIMIT_X2_PULLUP
#endif
#ifdef LIMIT_Y2_PULLUP_ENABLE
#define LIMIT_Y2_PULLUP
#endif
#ifdef LIMIT_Z2_PULLUP_ENABLE
#define LIMIT_Z2_PULLUP
#endif
#ifdef LIMIT_A_PULLUP_ENABLE
#define LIMIT_A_PULLUP
#endif
#ifdef LIMIT_B_PULLUP_ENABLE
#define LIMIT_B_PULLUP
#endif
#ifdef LIMIT_C_PULLUP_ENABLE
#define LIMIT_C_PULLUP
#endif

#ifdef PROBE_PULLUP_ENABLE
#define PROBE_PULLUP
#endif

#ifdef ESTOP_PULLUP_ENABLE
#define ESTOP_PULLUP
#endif
#ifdef SAFETY_DOOR_PULLUP_ENABLE
#define SAFETY_DOOR_PULLUP
#endif
#ifdef FHOLD_PULLUP_ENABLE
#define FHOLD_PULLUP
#endif
#ifdef CS_RES_PULLUP_ENABLE
#define CS_RES_PULLUP
#endif

#ifndef ENCODERS
#define ENCODERS 0
#endif
Expand Down
15 changes: 15 additions & 0 deletions uCNC/src/cnc_hal_overrides.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//boardmap override dummy file

#ifndef CNC_HAL_OVERRIDES_H
#define CNC_HAL_OVERRIDES_H

#ifdef __cplusplus
extern "C"
{
#endif

#ifdef __cplusplus
}
#endif

#endif
1 change: 1 addition & 0 deletions uCNC/src/hal/boards/boarddefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ extern "C"
#error Undefined board
#endif

#include "boardmap_overrides.h"
#include "../mcus/mcudefs.h" //configures the MCU for the selected board

#ifdef __cplusplus
Expand Down
15 changes: 15 additions & 0 deletions uCNC/src/hal/boards/boardmap_overrides.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//boardmap override dummy file

#ifndef BOARDMAP_OVERRIDES_H
#define BOARDMAP_OVERRIDES_H

#ifdef __cplusplus
extern "C"
{
#endif

#ifdef __cplusplus
}
#endif

#endif

0 comments on commit b2ad799

Please sign in to comment.