Configtool: replace DISPLAY_BUS parameter with a set of booleans.
Having a choice with a defined set of options is nice, but it also requires these options to be #defined somewhere _before_ entering config.h. To keep class-like encapsulation, we'd need two header files for each code unit, one for the options, another one for the usual header. That said, we use other examples of such options, e.g. CPU, F_CPU or KINEMATICS. For CPU and F_CPU it works fine, because their options are numbers or other values known by the compiler. For KINEMATICS it kind of works, because this #define is used in only one place ... and there it's suboptimal already, because no option- set. Anyways, I was unsure about this change and if it turns out to be a poor decision later, it can be reverted.
This commit is contained in:
parent
4d37d35f29
commit
90969978df
|
|
@ -283,25 +283,20 @@ DEFINE_HEATER(fan, DIO8, 0, 1)
|
|||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
/** \def DISPLAY_BUS_OPT
|
||||
/** \def DISPLAY_BUS_4BIT DISPLAY_BUS_8BIT DISPLAY_BUS_I2C DISPLAY_BUS_SPI
|
||||
|
||||
Display buses a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
The bus used to connect the display to the controller. This is a property
|
||||
of the display. With most displays there can be only one correct choice.
|
||||
|
||||
Comment in the one in use, comment out all others. If there is no display,
|
||||
comment out all of them to remove display code for better performance.
|
||||
*/
|
||||
//#define DISPLAY_BUS_OPT disabled
|
||||
//#define DISPLAY_BUS_OPT direct_4bit
|
||||
//#define DISPLAY_BUS_OPT direct_8bit
|
||||
//#define DISPLAY_BUS_OPT i2c_twi
|
||||
//#define DISPLAY_BUS_OPT spi
|
||||
|
||||
/** \def DISPLAY_BUS
|
||||
|
||||
The display bus in use. 'disabled' if there is no display.
|
||||
*/
|
||||
#define DISPLAY_BUS disabled
|
||||
|
||||
/** \def DISPLAY_TYPE_OPT
|
||||
//#define DISPLAY_BUS_4BIT
|
||||
//#define DISPLAY_BUS_8BIT
|
||||
//#define DISPLAY_BUS_I2C
|
||||
//#define DISPLAY_BUS_SPI
|
||||
|
||||
/**
|
||||
Display types a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -279,25 +279,20 @@ DEFINE_HEATER(extruder, AIO2, 0, 1)
|
|||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
/** \def DISPLAY_BUS_OPT
|
||||
/** \def DISPLAY_BUS_4BIT DISPLAY_BUS_8BIT DISPLAY_BUS_I2C DISPLAY_BUS_SPI
|
||||
|
||||
Display buses a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
The bus used to connect the display to the controller. This is a property
|
||||
of the display. With most displays there can be only one correct choice.
|
||||
|
||||
Comment in the one in use, comment out all others. If there is no display,
|
||||
comment out all of them to remove display code for better performance.
|
||||
*/
|
||||
//#define DISPLAY_BUS_OPT disabled
|
||||
//#define DISPLAY_BUS_OPT direct_4bit
|
||||
//#define DISPLAY_BUS_OPT direct_8bit
|
||||
//#define DISPLAY_BUS_OPT i2c_twi
|
||||
//#define DISPLAY_BUS_OPT spi
|
||||
|
||||
/** \def DISPLAY_BUS
|
||||
|
||||
The display bus in use. 'disabled' if there is no display.
|
||||
*/
|
||||
#define DISPLAY_BUS disabled
|
||||
|
||||
/** \def DISPLAY_TYPE_OPT
|
||||
//#define DISPLAY_BUS_4BIT
|
||||
//#define DISPLAY_BUS_8BIT
|
||||
//#define DISPLAY_BUS_I2C
|
||||
//#define DISPLAY_BUS_SPI
|
||||
|
||||
/**
|
||||
Display types a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -271,25 +271,20 @@ DEFINE_TEMP_SENSOR(noheater, TT_INTERCOM, AIO0, 0)
|
|||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
/** \def DISPLAY_BUS_OPT
|
||||
/** \def DISPLAY_BUS_4BIT DISPLAY_BUS_8BIT DISPLAY_BUS_I2C DISPLAY_BUS_SPI
|
||||
|
||||
Display buses a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
The bus used to connect the display to the controller. This is a property
|
||||
of the display. With most displays there can be only one correct choice.
|
||||
|
||||
Comment in the one in use, comment out all others. If there is no display,
|
||||
comment out all of them to remove display code for better performance.
|
||||
*/
|
||||
//#define DISPLAY_BUS_OPT disabled
|
||||
//#define DISPLAY_BUS_OPT direct_4bit
|
||||
//#define DISPLAY_BUS_OPT direct_8bit
|
||||
//#define DISPLAY_BUS_OPT i2c_twi
|
||||
//#define DISPLAY_BUS_OPT spi
|
||||
|
||||
/** \def DISPLAY_BUS
|
||||
|
||||
The display bus in use. 'disabled' if there is no display.
|
||||
*/
|
||||
#define DISPLAY_BUS disabled
|
||||
|
||||
/** \def DISPLAY_TYPE_OPT
|
||||
//#define DISPLAY_BUS_4BIT
|
||||
//#define DISPLAY_BUS_8BIT
|
||||
//#define DISPLAY_BUS_I2C
|
||||
//#define DISPLAY_BUS_SPI
|
||||
|
||||
/**
|
||||
Display types a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -274,25 +274,20 @@ DEFINE_HEATER(extruder, DIO6, 0, 1)
|
|||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
/** \def DISPLAY_BUS_OPT
|
||||
/** \def DISPLAY_BUS_4BIT DISPLAY_BUS_8BIT DISPLAY_BUS_I2C DISPLAY_BUS_SPI
|
||||
|
||||
Display buses a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
The bus used to connect the display to the controller. This is a property
|
||||
of the display. With most displays there can be only one correct choice.
|
||||
|
||||
Comment in the one in use, comment out all others. If there is no display,
|
||||
comment out all of them to remove display code for better performance.
|
||||
*/
|
||||
//#define DISPLAY_BUS_OPT disabled
|
||||
//#define DISPLAY_BUS_OPT direct_4bit
|
||||
//#define DISPLAY_BUS_OPT direct_8bit
|
||||
//#define DISPLAY_BUS_OPT i2c_twi
|
||||
//#define DISPLAY_BUS_OPT spi
|
||||
|
||||
/** \def DISPLAY_BUS
|
||||
|
||||
The display bus in use. 'disabled' if there is no display.
|
||||
*/
|
||||
#define DISPLAY_BUS disabled
|
||||
|
||||
/** \def DISPLAY_TYPE_OPT
|
||||
//#define DISPLAY_BUS_4BIT
|
||||
//#define DISPLAY_BUS_8BIT
|
||||
//#define DISPLAY_BUS_I2C
|
||||
//#define DISPLAY_BUS_SPI
|
||||
|
||||
/**
|
||||
Display types a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -289,25 +289,20 @@ DEFINE_HEATER(bed, PIO1_9, 1, 10)
|
|||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
/** \def DISPLAY_BUS_OPT
|
||||
/** \def DISPLAY_BUS_4BIT DISPLAY_BUS_8BIT DISPLAY_BUS_I2C DISPLAY_BUS_SPI
|
||||
|
||||
Display buses a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
The bus used to connect the display to the controller. This is a property
|
||||
of the display. With most displays there can be only one correct choice.
|
||||
|
||||
Comment in the one in use, comment out all others. If there is no display,
|
||||
comment out all of them to remove display code for better performance.
|
||||
*/
|
||||
//#define DISPLAY_BUS_OPT disabled
|
||||
//#define DISPLAY_BUS_OPT direct_4bit
|
||||
//#define DISPLAY_BUS_OPT direct_8bit
|
||||
//#define DISPLAY_BUS_OPT i2c_twi
|
||||
//#define DISPLAY_BUS_OPT spi
|
||||
|
||||
/** \def DISPLAY_BUS
|
||||
|
||||
The display bus in use. 'disabled' if there is no display.
|
||||
*/
|
||||
#define DISPLAY_BUS disabled
|
||||
|
||||
/** \def DISPLAY_TYPE_OPT
|
||||
//#define DISPLAY_BUS_4BIT
|
||||
//#define DISPLAY_BUS_8BIT
|
||||
//#define DISPLAY_BUS_I2C
|
||||
//#define DISPLAY_BUS_SPI
|
||||
|
||||
/**
|
||||
Display types a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -285,25 +285,20 @@ DEFINE_HEATER(bed, DIO3, 0, 1)
|
|||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
/** \def DISPLAY_BUS_OPT
|
||||
/** \def DISPLAY_BUS_4BIT DISPLAY_BUS_8BIT DISPLAY_BUS_I2C DISPLAY_BUS_SPI
|
||||
|
||||
Display buses a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
The bus used to connect the display to the controller. This is a property
|
||||
of the display. With most displays there can be only one correct choice.
|
||||
|
||||
Comment in the one in use, comment out all others. If there is no display,
|
||||
comment out all of them to remove display code for better performance.
|
||||
*/
|
||||
//#define DISPLAY_BUS_OPT disabled
|
||||
//#define DISPLAY_BUS_OPT direct_4bit
|
||||
//#define DISPLAY_BUS_OPT direct_8bit
|
||||
//#define DISPLAY_BUS_OPT i2c_twi
|
||||
//#define DISPLAY_BUS_OPT spi
|
||||
|
||||
/** \def DISPLAY_BUS
|
||||
|
||||
The display bus in use. 'disabled' if there is no display.
|
||||
*/
|
||||
#define DISPLAY_BUS disabled
|
||||
|
||||
/** \def DISPLAY_TYPE_OPT
|
||||
//#define DISPLAY_BUS_4BIT
|
||||
//#define DISPLAY_BUS_8BIT
|
||||
//#define DISPLAY_BUS_I2C
|
||||
//#define DISPLAY_BUS_SPI
|
||||
|
||||
/**
|
||||
Display types a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -286,25 +286,20 @@ DEFINE_HEATER(bed, DIO3, 0, 1)
|
|||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
/** \def DISPLAY_BUS_OPT
|
||||
/** \def DISPLAY_BUS_4BIT DISPLAY_BUS_8BIT DISPLAY_BUS_I2C DISPLAY_BUS_SPI
|
||||
|
||||
Display buses a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
The bus used to connect the display to the controller. This is a property
|
||||
of the display. With most displays there can be only one correct choice.
|
||||
|
||||
Comment in the one in use, comment out all others. If there is no display,
|
||||
comment out all of them to remove display code for better performance.
|
||||
*/
|
||||
//#define DISPLAY_BUS_OPT disabled
|
||||
//#define DISPLAY_BUS_OPT direct_4bit
|
||||
//#define DISPLAY_BUS_OPT direct_8bit
|
||||
//#define DISPLAY_BUS_OPT i2c_twi
|
||||
//#define DISPLAY_BUS_OPT spi
|
||||
|
||||
/** \def DISPLAY_BUS
|
||||
|
||||
The display bus in use. 'disabled' if there is no display.
|
||||
*/
|
||||
#define DISPLAY_BUS disabled
|
||||
|
||||
/** \def DISPLAY_TYPE_OPT
|
||||
//#define DISPLAY_BUS_4BIT
|
||||
//#define DISPLAY_BUS_8BIT
|
||||
//#define DISPLAY_BUS_I2C
|
||||
//#define DISPLAY_BUS_SPI
|
||||
|
||||
/**
|
||||
Display types a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -287,25 +287,20 @@ DEFINE_HEATER(fan, DIO4, 0, 0)
|
|||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
/** \def DISPLAY_BUS_OPT
|
||||
/** \def DISPLAY_BUS_4BIT DISPLAY_BUS_8BIT DISPLAY_BUS_I2C DISPLAY_BUS_SPI
|
||||
|
||||
Display buses a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
The bus used to connect the display to the controller. This is a property
|
||||
of the display. With most displays there can be only one correct choice.
|
||||
|
||||
Comment in the one in use, comment out all others. If there is no display,
|
||||
comment out all of them to remove display code for better performance.
|
||||
*/
|
||||
//#define DISPLAY_BUS_OPT disabled
|
||||
//#define DISPLAY_BUS_OPT direct_4bit
|
||||
//#define DISPLAY_BUS_OPT direct_8bit
|
||||
//#define DISPLAY_BUS_OPT i2c_twi
|
||||
//#define DISPLAY_BUS_OPT spi
|
||||
|
||||
/** \def DISPLAY_BUS
|
||||
|
||||
The display bus in use. 'disabled' if there is no display.
|
||||
*/
|
||||
#define DISPLAY_BUS disabled
|
||||
|
||||
/** \def DISPLAY_TYPE_OPT
|
||||
//#define DISPLAY_BUS_4BIT
|
||||
//#define DISPLAY_BUS_8BIT
|
||||
//#define DISPLAY_BUS_I2C
|
||||
//#define DISPLAY_BUS_SPI
|
||||
|
||||
/**
|
||||
Display types a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -283,25 +283,20 @@ DEFINE_HEATER(bed, DIO3, 0, 1)
|
|||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
/** \def DISPLAY_BUS_OPT
|
||||
/** \def DISPLAY_BUS_4BIT DISPLAY_BUS_8BIT DISPLAY_BUS_I2C DISPLAY_BUS_SPI
|
||||
|
||||
Display buses a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
The bus used to connect the display to the controller. This is a property
|
||||
of the display. With most displays there can be only one correct choice.
|
||||
|
||||
Comment in the one in use, comment out all others. If there is no display,
|
||||
comment out all of them to remove display code for better performance.
|
||||
*/
|
||||
//#define DISPLAY_BUS_OPT disabled
|
||||
//#define DISPLAY_BUS_OPT direct_4bit
|
||||
//#define DISPLAY_BUS_OPT direct_8bit
|
||||
//#define DISPLAY_BUS_OPT i2c_twi
|
||||
//#define DISPLAY_BUS_OPT spi
|
||||
|
||||
/** \def DISPLAY_BUS
|
||||
|
||||
The display bus in use. 'disabled' if there is no display.
|
||||
*/
|
||||
#define DISPLAY_BUS i2c_twi
|
||||
|
||||
/** \def DISPLAY_TYPE_OPT
|
||||
//#define DISPLAY_BUS_4BIT
|
||||
//#define DISPLAY_BUS_8BIT
|
||||
#define DISPLAY_BUS_I2C
|
||||
//#define DISPLAY_BUS_SPI
|
||||
|
||||
/**
|
||||
Display types a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -284,25 +284,20 @@ DEFINE_HEATER(fan, DIO9, 0, 1)
|
|||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
/** \def DISPLAY_BUS_OPT
|
||||
/** \def DISPLAY_BUS_4BIT DISPLAY_BUS_8BIT DISPLAY_BUS_I2C DISPLAY_BUS_SPI
|
||||
|
||||
Display buses a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
The bus used to connect the display to the controller. This is a property
|
||||
of the display. With most displays there can be only one correct choice.
|
||||
|
||||
Comment in the one in use, comment out all others. If there is no display,
|
||||
comment out all of them to remove display code for better performance.
|
||||
*/
|
||||
//#define DISPLAY_BUS_OPT disabled
|
||||
//#define DISPLAY_BUS_OPT direct_4bit
|
||||
//#define DISPLAY_BUS_OPT direct_8bit
|
||||
//#define DISPLAY_BUS_OPT i2c_twi
|
||||
//#define DISPLAY_BUS_OPT spi
|
||||
|
||||
/** \def DISPLAY_BUS
|
||||
|
||||
The display bus in use. 'disabled' if there is no display.
|
||||
*/
|
||||
#define DISPLAY_BUS disabled
|
||||
|
||||
/** \def DISPLAY_TYPE_OPT
|
||||
//#define DISPLAY_BUS_4BIT
|
||||
//#define DISPLAY_BUS_8BIT
|
||||
//#define DISPLAY_BUS_I2C
|
||||
//#define DISPLAY_BUS_SPI
|
||||
|
||||
/**
|
||||
Display types a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -287,25 +287,20 @@ DEFINE_HEATER(fan, DIO9, 0, 1)
|
|||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
/** \def DISPLAY_BUS_OPT
|
||||
/** \def DISPLAY_BUS_4BIT DISPLAY_BUS_8BIT DISPLAY_BUS_I2C DISPLAY_BUS_SPI
|
||||
|
||||
Display buses a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
The bus used to connect the display to the controller. This is a property
|
||||
of the display. With most displays there can be only one correct choice.
|
||||
|
||||
Comment in the one in use, comment out all others. If there is no display,
|
||||
comment out all of them to remove display code for better performance.
|
||||
*/
|
||||
//#define DISPLAY_BUS_OPT disabled
|
||||
//#define DISPLAY_BUS_OPT direct_4bit
|
||||
//#define DISPLAY_BUS_OPT direct_8bit
|
||||
//#define DISPLAY_BUS_OPT i2c_twi
|
||||
//#define DISPLAY_BUS_OPT spi
|
||||
|
||||
/** \def DISPLAY_BUS
|
||||
|
||||
The display bus in use. 'disabled' if there is no display.
|
||||
*/
|
||||
#define DISPLAY_BUS disabled
|
||||
|
||||
/** \def DISPLAY_TYPE_OPT
|
||||
//#define DISPLAY_BUS_4BIT
|
||||
//#define DISPLAY_BUS_8BIT
|
||||
//#define DISPLAY_BUS_I2C
|
||||
//#define DISPLAY_BUS_SPI
|
||||
|
||||
/**
|
||||
Display types a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -287,25 +287,20 @@ DEFINE_HEATER(fan, DIO8, 0, 1)
|
|||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
/** \def DISPLAY_BUS_OPT
|
||||
/** \def DISPLAY_BUS_4BIT DISPLAY_BUS_8BIT DISPLAY_BUS_I2C DISPLAY_BUS_SPI
|
||||
|
||||
Display buses a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
The bus used to connect the display to the controller. This is a property
|
||||
of the display. With most displays there can be only one correct choice.
|
||||
|
||||
Comment in the one in use, comment out all others. If there is no display,
|
||||
comment out all of them to remove display code for better performance.
|
||||
*/
|
||||
//#define DISPLAY_BUS_OPT disabled
|
||||
//#define DISPLAY_BUS_OPT direct_4bit
|
||||
//#define DISPLAY_BUS_OPT direct_8bit
|
||||
//#define DISPLAY_BUS_OPT i2c_twi
|
||||
//#define DISPLAY_BUS_OPT spi
|
||||
|
||||
/** \def DISPLAY_BUS
|
||||
|
||||
The display bus in use. 'disabled' if there is no display.
|
||||
*/
|
||||
#define DISPLAY_BUS disabled
|
||||
|
||||
/** \def DISPLAY_TYPE_OPT
|
||||
//#define DISPLAY_BUS_4BIT
|
||||
//#define DISPLAY_BUS_8BIT
|
||||
//#define DISPLAY_BUS_I2C
|
||||
//#define DISPLAY_BUS_SPI
|
||||
|
||||
/**
|
||||
Display types a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -283,25 +283,20 @@ DEFINE_HEATER(bed, DIO14, 0, 1)
|
|||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
/** \def DISPLAY_BUS_OPT
|
||||
/** \def DISPLAY_BUS_4BIT DISPLAY_BUS_8BIT DISPLAY_BUS_I2C DISPLAY_BUS_SPI
|
||||
|
||||
Display buses a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
The bus used to connect the display to the controller. This is a property
|
||||
of the display. With most displays there can be only one correct choice.
|
||||
|
||||
Comment in the one in use, comment out all others. If there is no display,
|
||||
comment out all of them to remove display code for better performance.
|
||||
*/
|
||||
//#define DISPLAY_BUS_OPT disabled
|
||||
//#define DISPLAY_BUS_OPT direct_4bit
|
||||
//#define DISPLAY_BUS_OPT direct_8bit
|
||||
//#define DISPLAY_BUS_OPT i2c_twi
|
||||
//#define DISPLAY_BUS_OPT spi
|
||||
|
||||
/** \def DISPLAY_BUS
|
||||
|
||||
The display bus in use. 'disabled' if there is no display.
|
||||
*/
|
||||
#define DISPLAY_BUS disabled
|
||||
|
||||
/** \def DISPLAY_TYPE_OPT
|
||||
//#define DISPLAY_BUS_4BIT
|
||||
//#define DISPLAY_BUS_8BIT
|
||||
//#define DISPLAY_BUS_I2C
|
||||
//#define DISPLAY_BUS_SPI
|
||||
|
||||
/**
|
||||
Display types a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -283,25 +283,20 @@ DEFINE_HEATER(bed, DIO13, 0, 1)
|
|||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
/** \def DISPLAY_BUS_OPT
|
||||
/** \def DISPLAY_BUS_4BIT DISPLAY_BUS_8BIT DISPLAY_BUS_I2C DISPLAY_BUS_SPI
|
||||
|
||||
Display buses a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
The bus used to connect the display to the controller. This is a property
|
||||
of the display. With most displays there can be only one correct choice.
|
||||
|
||||
Comment in the one in use, comment out all others. If there is no display,
|
||||
comment out all of them to remove display code for better performance.
|
||||
*/
|
||||
//#define DISPLAY_BUS_OPT disabled
|
||||
//#define DISPLAY_BUS_OPT direct_4bit
|
||||
//#define DISPLAY_BUS_OPT direct_8bit
|
||||
//#define DISPLAY_BUS_OPT i2c_twi
|
||||
//#define DISPLAY_BUS_OPT spi
|
||||
|
||||
/** \def DISPLAY_BUS
|
||||
|
||||
The display bus in use. 'disabled' if there is no display.
|
||||
*/
|
||||
#define DISPLAY_BUS disabled
|
||||
|
||||
/** \def DISPLAY_TYPE_OPT
|
||||
//#define DISPLAY_BUS_4BIT
|
||||
//#define DISPLAY_BUS_8BIT
|
||||
//#define DISPLAY_BUS_I2C
|
||||
//#define DISPLAY_BUS_SPI
|
||||
|
||||
/**
|
||||
Display types a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -283,25 +283,20 @@ DEFINE_HEATER(bed, DIO4, 0, 1)
|
|||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
/** \def DISPLAY_BUS_OPT
|
||||
/** \def DISPLAY_BUS_4BIT DISPLAY_BUS_8BIT DISPLAY_BUS_I2C DISPLAY_BUS_SPI
|
||||
|
||||
Display buses a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
The bus used to connect the display to the controller. This is a property
|
||||
of the display. With most displays there can be only one correct choice.
|
||||
|
||||
Comment in the one in use, comment out all others. If there is no display,
|
||||
comment out all of them to remove display code for better performance.
|
||||
*/
|
||||
//#define DISPLAY_BUS_OPT disabled
|
||||
//#define DISPLAY_BUS_OPT direct_4bit
|
||||
//#define DISPLAY_BUS_OPT direct_8bit
|
||||
//#define DISPLAY_BUS_OPT i2c_twi
|
||||
//#define DISPLAY_BUS_OPT spi
|
||||
|
||||
/** \def DISPLAY_BUS
|
||||
|
||||
The display bus in use. 'disabled' if there is no display.
|
||||
*/
|
||||
#define DISPLAY_BUS disabled
|
||||
|
||||
/** \def DISPLAY_TYPE_OPT
|
||||
//#define DISPLAY_BUS_4BIT
|
||||
//#define DISPLAY_BUS_8BIT
|
||||
//#define DISPLAY_BUS_I2C
|
||||
//#define DISPLAY_BUS_SPI
|
||||
|
||||
/**
|
||||
Display types a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -286,25 +286,20 @@ DEFINE_HEATER(fan, DIO5, 0, 1)
|
|||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
/** \def DISPLAY_BUS_OPT
|
||||
/** \def DISPLAY_BUS_4BIT DISPLAY_BUS_8BIT DISPLAY_BUS_I2C DISPLAY_BUS_SPI
|
||||
|
||||
Display buses a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
The bus used to connect the display to the controller. This is a property
|
||||
of the display. With most displays there can be only one correct choice.
|
||||
|
||||
Comment in the one in use, comment out all others. If there is no display,
|
||||
comment out all of them to remove display code for better performance.
|
||||
*/
|
||||
//#define DISPLAY_BUS_OPT disabled
|
||||
//#define DISPLAY_BUS_OPT direct_4bit
|
||||
//#define DISPLAY_BUS_OPT direct_8bit
|
||||
//#define DISPLAY_BUS_OPT i2c_twi
|
||||
//#define DISPLAY_BUS_OPT spi
|
||||
|
||||
/** \def DISPLAY_BUS
|
||||
|
||||
The display bus in use. 'disabled' if there is no display.
|
||||
*/
|
||||
#define DISPLAY_BUS disabled
|
||||
|
||||
/** \def DISPLAY_TYPE_OPT
|
||||
//#define DISPLAY_BUS_4BIT
|
||||
//#define DISPLAY_BUS_8BIT
|
||||
//#define DISPLAY_BUS_I2C
|
||||
//#define DISPLAY_BUS_SPI
|
||||
|
||||
/**
|
||||
Display types a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -283,25 +283,20 @@ DEFINE_HEATER(fan, DIO16, 0, 0)
|
|||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
/** \def DISPLAY_BUS_OPT
|
||||
/** \def DISPLAY_BUS_4BIT DISPLAY_BUS_8BIT DISPLAY_BUS_I2C DISPLAY_BUS_SPI
|
||||
|
||||
Display buses a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
The bus used to connect the display to the controller. This is a property
|
||||
of the display. With most displays there can be only one correct choice.
|
||||
|
||||
Comment in the one in use, comment out all others. If there is no display,
|
||||
comment out all of them to remove display code for better performance.
|
||||
*/
|
||||
//#define DISPLAY_BUS_OPT disabled
|
||||
//#define DISPLAY_BUS_OPT direct_4bit
|
||||
//#define DISPLAY_BUS_OPT direct_8bit
|
||||
//#define DISPLAY_BUS_OPT i2c_twi
|
||||
//#define DISPLAY_BUS_OPT spi
|
||||
|
||||
/** \def DISPLAY_BUS
|
||||
|
||||
The display bus in use. 'disabled' if there is no display.
|
||||
*/
|
||||
#define DISPLAY_BUS disabled
|
||||
|
||||
/** \def DISPLAY_TYPE_OPT
|
||||
//#define DISPLAY_BUS_4BIT
|
||||
//#define DISPLAY_BUS_8BIT
|
||||
//#define DISPLAY_BUS_I2C
|
||||
//#define DISPLAY_BUS_SPI
|
||||
|
||||
/**
|
||||
Display types a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -283,25 +283,20 @@ DEFINE_HEATER(fan, DIO8, 0, 0)
|
|||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
/** \def DISPLAY_BUS_OPT
|
||||
/** \def DISPLAY_BUS_4BIT DISPLAY_BUS_8BIT DISPLAY_BUS_I2C DISPLAY_BUS_SPI
|
||||
|
||||
Display buses a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
The bus used to connect the display to the controller. This is a property
|
||||
of the display. With most displays there can be only one correct choice.
|
||||
|
||||
Comment in the one in use, comment out all others. If there is no display,
|
||||
comment out all of them to remove display code for better performance.
|
||||
*/
|
||||
//#define DISPLAY_BUS_OPT disabled
|
||||
//#define DISPLAY_BUS_OPT direct_4bit
|
||||
//#define DISPLAY_BUS_OPT direct_8bit
|
||||
//#define DISPLAY_BUS_OPT i2c_twi
|
||||
//#define DISPLAY_BUS_OPT spi
|
||||
|
||||
/** \def DISPLAY_BUS
|
||||
|
||||
The display bus in use. 'disabled' if there is no display.
|
||||
*/
|
||||
#define DISPLAY_BUS disabled
|
||||
|
||||
/** \def DISPLAY_TYPE_OPT
|
||||
//#define DISPLAY_BUS_4BIT
|
||||
//#define DISPLAY_BUS_8BIT
|
||||
//#define DISPLAY_BUS_I2C
|
||||
//#define DISPLAY_BUS_SPI
|
||||
|
||||
/**
|
||||
Display types a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -285,25 +285,20 @@ DEFINE_HEATER(fan, DIO4, 0, 1)
|
|||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
/** \def DISPLAY_BUS_OPT
|
||||
/** \def DISPLAY_BUS_4BIT DISPLAY_BUS_8BIT DISPLAY_BUS_I2C DISPLAY_BUS_SPI
|
||||
|
||||
Display buses a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
The bus used to connect the display to the controller. This is a property
|
||||
of the display. With most displays there can be only one correct choice.
|
||||
|
||||
Comment in the one in use, comment out all others. If there is no display,
|
||||
comment out all of them to remove display code for better performance.
|
||||
*/
|
||||
//#define DISPLAY_BUS_OPT disabled
|
||||
//#define DISPLAY_BUS_OPT direct_4bit
|
||||
//#define DISPLAY_BUS_OPT direct_8bit
|
||||
//#define DISPLAY_BUS_OPT i2c_twi
|
||||
//#define DISPLAY_BUS_OPT spi
|
||||
|
||||
/** \def DISPLAY_BUS
|
||||
|
||||
The display bus in use. 'disabled' if there is no display.
|
||||
*/
|
||||
#define DISPLAY_BUS disabled
|
||||
|
||||
/** \def DISPLAY_TYPE_OPT
|
||||
//#define DISPLAY_BUS_4BIT
|
||||
//#define DISPLAY_BUS_8BIT
|
||||
//#define DISPLAY_BUS_I2C
|
||||
//#define DISPLAY_BUS_SPI
|
||||
|
||||
/**
|
||||
Display types a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,14 +1,4 @@
|
|||
|
||||
/**
|
||||
Display bus stuff. This likely goes away soon or gets at least moved
|
||||
elsewhere.
|
||||
*/
|
||||
#define disabled 0
|
||||
#define direct_4bit 1
|
||||
#define direct_8bit 2
|
||||
#define i2c_twi 3
|
||||
#define spi 4
|
||||
|
||||
/**
|
||||
Some stuff common to all config.h files. Put it here to allow files like
|
||||
board.*.config.h or printer.*.h to be moved to about everywhere in the
|
||||
|
|
@ -55,7 +45,7 @@
|
|||
/**
|
||||
Check wether we need I2C.
|
||||
*/
|
||||
#if DISPLAY_BUS == i2c_twi
|
||||
#ifdef DISPLAY_BUS_I2C
|
||||
#define I2C
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -271,22 +271,18 @@
|
|||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
/** \def DISPLAY_BUS_OPT
|
||||
/** \def DISPLAY_BUS_4BIT DISPLAY_BUS_8BIT DISPLAY_BUS_I2C DISPLAY_BUS_SPI
|
||||
|
||||
Display buses a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
The bus used to connect the display to the controller. This is a property
|
||||
of the display. With most displays there can be only one correct choice.
|
||||
|
||||
Comment in the one in use, comment out all others. If there is no display,
|
||||
comment out all of them to remove display code for better performance.
|
||||
*/
|
||||
//#define DISPLAY_BUS_OPT disabled
|
||||
//#define DISPLAY_BUS_OPT direct_4bit
|
||||
//#define DISPLAY_BUS_OPT direct_8bit
|
||||
//#define DISPLAY_BUS_OPT i2c_twi
|
||||
//#define DISPLAY_BUS_OPT spi
|
||||
|
||||
/** \def DISPLAY_BUS
|
||||
|
||||
The display bus in use. 'disabled' if there is no display.
|
||||
*/
|
||||
#define DISPLAY_BUS disabled
|
||||
#define DISPLAY_BUS_4BIT
|
||||
#define DISPLAY_BUS_8BIT
|
||||
#define DISPLAY_BUS_I2C
|
||||
#define DISPLAY_BUS_SPI
|
||||
|
||||
/** \def DISPLAY_TYPE_OPT
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ from configtool.data import (defineValueFormat,
|
|||
reStartSensors, reEndSensors, reStartHeaters,
|
||||
reEndHeaters, reCandHeatPins, reCandThermPins,
|
||||
reCandProcessors, reCandCPUClocks, reFloatAttr,
|
||||
reCandDisplayBuses, reCandDisplayTypes,
|
||||
reCandDisplayTypes,
|
||||
reDefine, reDefineBL, reDefQS, reDefQSm,
|
||||
reDefQSm2, reDefBool, reDefBoolBL, reDefHT,
|
||||
reDefTS, reDefTT, reSensor, reHeater3, reHeater4,
|
||||
|
|
@ -218,7 +218,6 @@ class BoardPanel(wx.Panel):
|
|||
self.candThermPins = []
|
||||
self.candProcessors = []
|
||||
self.candClocks = []
|
||||
self.candDisplayBuses = []
|
||||
self.candDisplayTypes = []
|
||||
self.tempTables = {}
|
||||
gatheringHelpText = False
|
||||
|
|
@ -278,7 +277,6 @@ class BoardPanel(wx.Panel):
|
|||
self.candThermPins = []
|
||||
self.candProcessors = []
|
||||
self.candClocks = []
|
||||
self.candDisplayBuses = []
|
||||
self.candDisplayTypes = []
|
||||
self.tempTables = {}
|
||||
gatheringHelpText = False
|
||||
|
|
@ -336,7 +334,6 @@ class BoardPanel(wx.Panel):
|
|||
#print self.candThermPins
|
||||
#print self.candProcessors
|
||||
#print self.candClocks
|
||||
#print self.candDisplayBuses
|
||||
#print self.candDisplayTypes
|
||||
#print self.tempTables
|
||||
#print self.cfgValues # #defines with a value and enabled booleans.
|
||||
|
|
@ -362,7 +359,6 @@ class BoardPanel(wx.Panel):
|
|||
self.pgSensors.setCandidatePins(self.candThermPins)
|
||||
self.pgCpu.setCandidateProcessors(self.candProcessors)
|
||||
self.pgCpu.setCandidateClocks(self.candClocks)
|
||||
self.pgDisplay.setCandidateDisplayBuses(self.candDisplayBuses)
|
||||
self.pgDisplay.setCandidateDisplayTypes(self.candDisplayTypes)
|
||||
|
||||
for pg in self.pages:
|
||||
|
|
@ -448,13 +444,6 @@ class BoardPanel(wx.Panel):
|
|||
self.candClocks.append(t[0])
|
||||
return True
|
||||
|
||||
m = reCandDisplayBuses.match(ln)
|
||||
if m:
|
||||
t = m.groups()
|
||||
if len(t) == 1:
|
||||
self.candDisplayBuses.append(t[0])
|
||||
return True
|
||||
|
||||
m = reCandDisplayTypes.match(ln)
|
||||
if m:
|
||||
t = m.groups()
|
||||
|
|
@ -585,7 +574,6 @@ class BoardPanel(wx.Panel):
|
|||
candHeatPinsWritten = False
|
||||
candProcessorsWritten = False
|
||||
candCPUClocksWritten = False
|
||||
candDisplayBusesWritten = False
|
||||
candDisplayTypesWritten = False
|
||||
|
||||
for ln in self.cfgBuffer:
|
||||
|
|
@ -675,13 +663,6 @@ class BoardPanel(wx.Panel):
|
|||
candCPUClocksWritten = True
|
||||
continue
|
||||
|
||||
if reCandDisplayBuses.match(ln):
|
||||
if not candDisplayBusesWritten:
|
||||
for value in self.candDisplayBuses:
|
||||
fp.write("//#define DISPLAY_BUS_OPT {}\n".format(value))
|
||||
candDisplayBusesWritten = True
|
||||
continue
|
||||
|
||||
if reCandDisplayTypes.match(ln):
|
||||
if not candDisplayTypesWritten:
|
||||
for value in self.candDisplayTypes:
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ reCandHeatPins = re.compile("^\s*//\s*#define\s+HEATER_PIN\s+(\w+)")
|
|||
reCandThermPins = re.compile("^\s*//\s*#define\s+TEMP_SENSOR_PIN\s+(\w+)")
|
||||
reCandProcessors = re.compile("^\s*//\s*#define\s+CPU_TYPE\s+(\w+)")
|
||||
reCandCPUClocks = re.compile("^\s*//\s*#define\s+F_CPU_OPT\s+(\w+)")
|
||||
reCandDisplayBuses = re.compile("^\s*//\s*#define\s+DISPLAY_BUS_OPT\s+(\w+)")
|
||||
reCandDisplayTypes = re.compile("^\s*//\s*#define\s+DISPLAY_TYPE_OPT\s+(\w+)")
|
||||
|
||||
reHelpTextStart = re.compile("^\s*/\*\*\s+\\\\def\s+(.*)")
|
||||
|
|
|
|||
|
|
@ -9,16 +9,19 @@ class DisplayPage(wx.Panel, Page):
|
|||
self.parent = parent
|
||||
self.id = idPg
|
||||
|
||||
self.displayBusKeys = ['DISPLAY_BUS_4BIT', 'DISPLAY_BUS_8BIT',
|
||||
'DISPLAY_BUS_I2C', 'DISPLAY_BUS_SPI']
|
||||
|
||||
self.labels = {'DISPLAY_BUS': "Display Bus:",
|
||||
'DISPLAY_TYPE': "Display Type:"}
|
||||
self.buses = []
|
||||
self.types = []
|
||||
|
||||
sz = wx.GridBagSizer()
|
||||
sz.AddSpacer((20, 40), pos = (0, 0))
|
||||
|
||||
k = 'DISPLAY_BUS'
|
||||
ch = self.addChoice(k, self.buses, 0, 100, self.onChoice, size = (140, -1))
|
||||
ch = self.addChoice(k, ['(disabled)'] + self.displayBusKeys, 0, 100,
|
||||
self.onChoice, size = (140, -1))
|
||||
sz.Add(ch, pos = (1, 1))
|
||||
sz.AddSpacer((100, 10), pos = (1, 2))
|
||||
|
||||
|
|
@ -30,13 +33,6 @@ class DisplayPage(wx.Panel, Page):
|
|||
self.SetSizer(sz)
|
||||
self.enableAll(False)
|
||||
|
||||
def setCandidateDisplayBuses(self, busList):
|
||||
k = 'DISPLAY_BUS'
|
||||
self.choices[k].Clear()
|
||||
for p in busList:
|
||||
self.choices[k].Append(p)
|
||||
self.buses = busList
|
||||
|
||||
def setCandidateDisplayTypes(self, typeList):
|
||||
k = 'DISPLAY_TYPE'
|
||||
self.choices[k].Clear()
|
||||
|
|
@ -47,7 +43,24 @@ class DisplayPage(wx.Panel, Page):
|
|||
def insertValues(self, cfgValues):
|
||||
Page.insertValues(self, cfgValues)
|
||||
|
||||
if len(self.buses) > 0:
|
||||
self.setChoice('DISPLAY_BUS', cfgValues, self.buses[0])
|
||||
k = 'DISPLAY_BUS'
|
||||
for tag in self.displayBusKeys:
|
||||
if tag in cfgValues.keys() and cfgValues[tag]:
|
||||
self.setChoice(k, cfgValues, tag)
|
||||
break
|
||||
|
||||
if len(self.types) > 0:
|
||||
self.setChoice('DISPLAY_TYPE', cfgValues, self.types[0])
|
||||
|
||||
def getValues(self):
|
||||
result = Page.getValues(self)
|
||||
|
||||
# Convert values to a set of booleans.
|
||||
for k in ('DISPLAY_BUS', ):
|
||||
del result[k]
|
||||
|
||||
choice = self.choices[k]
|
||||
for i in range(choice.GetCount()):
|
||||
result[choice.GetString(i)] = (i == choice.GetSelection())
|
||||
|
||||
return result
|
||||
|
|
|
|||
|
|
@ -673,22 +673,18 @@ PWM value for 'off'
|
|||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
/** \def DISPLAY_BUS_OPT
|
||||
/** \def DISPLAY_BUS_4BIT DISPLAY_BUS_8BIT DISPLAY_BUS_I2C DISPLAY_BUS_SPI
|
||||
|
||||
Display buses a user should be able to choose from in Configtool. All
|
||||
commented out.
|
||||
The bus used to connect the display to the controller. This is a property
|
||||
of the display. With most displays there can be only one correct choice.
|
||||
|
||||
Comment in the one in use, comment out all others. If there is no display,
|
||||
comment out all of them to remove display code for better performance.
|
||||
*/
|
||||
//#define DISPLAY_BUS_OPT disabled
|
||||
//#define DISPLAY_BUS_OPT direct_4bit
|
||||
//#define DISPLAY_BUS_OPT direct_8bit
|
||||
//#define DISPLAY_BUS_OPT i2c_twi
|
||||
//#define DISPLAY_BUS_OPT spi
|
||||
|
||||
/** \def DISPLAY_BUS
|
||||
|
||||
The display bus in use. 'disabled' if there is no display.
|
||||
*/
|
||||
#define DISPLAY_BUS disabled
|
||||
#define DISPLAY_BUS_4BIT
|
||||
#define DISPLAY_BUS_8BIT
|
||||
#define DISPLAY_BUS_I2C
|
||||
#define DISPLAY_BUS_SPI
|
||||
|
||||
/** \def DISPLAY_TYPE_OPT
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue