Move MAX6675 initialisation from mendel.c to temp.c.
Also note a misplaced and misnamed pin.
This commit is contained in:
parent
b66ba4629a
commit
a9f1d00865
|
|
@ -6,6 +6,10 @@
|
||||||
#define SCK DIO52
|
#define SCK DIO52
|
||||||
#define MISO DIO50
|
#define MISO DIO50
|
||||||
#define MOSI DIO51
|
#define MOSI DIO51
|
||||||
|
// TODO: This depends on the board, so this definition is misplaced here,
|
||||||
|
// should be more appropriately named and go to config.h. It's used in
|
||||||
|
// temp.c and simulator.h and defines the Chip Select pin for an eventual
|
||||||
|
// MAX6675 temperature sensor.
|
||||||
#define SS DIO53
|
#define SS DIO53
|
||||||
|
|
||||||
// TWI (I2C)
|
// TWI (I2C)
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,10 @@
|
||||||
#define SCK DIO13
|
#define SCK DIO13
|
||||||
#define MISO DIO12
|
#define MISO DIO12
|
||||||
#define MOSI DIO11
|
#define MOSI DIO11
|
||||||
|
// TODO: This depends on the board, so this definition is misplaced here,
|
||||||
|
// should be more appropriately named and go to config.h. It's used in
|
||||||
|
// temp.c and simulator.h and defines the Chip Select pin for an eventual
|
||||||
|
// MAX6675 temperature sensor.
|
||||||
#define SS DIO10
|
#define SS DIO10
|
||||||
|
|
||||||
// TWI (I2C)
|
// TWI (I2C)
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,10 @@
|
||||||
#define SCK DIO1
|
#define SCK DIO1
|
||||||
#define MISO DIO3
|
#define MISO DIO3
|
||||||
#define MOSI DIO2
|
#define MOSI DIO2
|
||||||
|
// TODO: This depends on the board, so this definition is misplaced here,
|
||||||
|
// should be more appropriately named and go to config.h. It's used in
|
||||||
|
// temp.c and simulator.h and defines the Chip Select pin for an eventual
|
||||||
|
// MAX6675 temperature sensor.
|
||||||
#define SS DIO0
|
#define SS DIO0
|
||||||
|
|
||||||
// TWI (I2C)
|
// TWI (I2C)
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,10 @@
|
||||||
#define SCK DIO7
|
#define SCK DIO7
|
||||||
#define MISO DIO6
|
#define MISO DIO6
|
||||||
#define MOSI DIO5
|
#define MOSI DIO5
|
||||||
|
// TODO: This depends on the board, so this definition is misplaced here,
|
||||||
|
// should be more appropriately named and go to config.h. It's used in
|
||||||
|
// temp.c and simulator.h and defines the Chip Select pin for an eventual
|
||||||
|
// MAX6675 temperature sensor.
|
||||||
#define SS DIO4
|
#define SS DIO4
|
||||||
|
|
||||||
// TWI (I2C)
|
// TWI (I2C)
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,10 @@
|
||||||
#define SCK DIO9
|
#define SCK DIO9
|
||||||
#define MISO DIO11
|
#define MISO DIO11
|
||||||
#define MOSI DIO10
|
#define MOSI DIO10
|
||||||
|
// TODO: This depends on the board, so this definition is misplaced here,
|
||||||
|
// should be more appropriately named and go to config.h. It's used in
|
||||||
|
// temp.c and simulator.h and defines the Chip Select pin for an eventual
|
||||||
|
// MAX6675 temperature sensor.
|
||||||
#define SS DIO8
|
#define SS DIO8
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,10 @@
|
||||||
#define SCK DIO9
|
#define SCK DIO9
|
||||||
#define MISO DIO11
|
#define MISO DIO11
|
||||||
#define MOSI DIO10
|
#define MOSI DIO10
|
||||||
|
// TODO: This depends on the board, so this definition is misplaced here,
|
||||||
|
// should be more appropriately named and go to config.h. It's used in
|
||||||
|
// temp.c and simulator.h and defines the Chip Select pin for an eventual
|
||||||
|
// MAX6675 temperature sensor.
|
||||||
#define SS DIO8
|
#define SS DIO8
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
1
mendel.c
1
mendel.c
|
|
@ -184,7 +184,6 @@ void io_init(void) {
|
||||||
WRITE(SCK, 0); SET_OUTPUT(SCK);
|
WRITE(SCK, 0); SET_OUTPUT(SCK);
|
||||||
WRITE(MOSI, 1); SET_OUTPUT(MOSI);
|
WRITE(MOSI, 1); SET_OUTPUT(MOSI);
|
||||||
WRITE(MISO, 1); SET_INPUT(MISO);
|
WRITE(MISO, 1); SET_INPUT(MISO);
|
||||||
WRITE(SS, 1); SET_OUTPUT(SS);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef TEMP_INTERCOM
|
#ifdef TEMP_INTERCOM
|
||||||
|
|
|
||||||
13
temp.c
13
temp.c
|
|
@ -73,16 +73,17 @@ struct {
|
||||||
uint16_t next_read_time; ///< how long until we can read this sensor again?
|
uint16_t next_read_time; ///< how long until we can read this sensor again?
|
||||||
} temp_sensors_runtime[NUM_TEMP_SENSORS];
|
} temp_sensors_runtime[NUM_TEMP_SENSORS];
|
||||||
|
|
||||||
/// set up temp sensors. Currently only the 'intercom' sensor needs initialisation.
|
/// Set up temp sensors.
|
||||||
void temp_init() {
|
void temp_init() {
|
||||||
temp_sensor_t i;
|
temp_sensor_t i;
|
||||||
for (i = 0; i < NUM_TEMP_SENSORS; i++) {
|
for (i = 0; i < NUM_TEMP_SENSORS; i++) {
|
||||||
switch(temp_sensors[i].temp_type) {
|
switch(temp_sensors[i].temp_type) {
|
||||||
#ifdef TEMP_MAX6675
|
#ifdef TEMP_MAX6675
|
||||||
// initialised when read
|
case TT_MAX6675:
|
||||||
/* case TT_MAX6675:
|
WRITE(SS, 1); // Turn sensor off.
|
||||||
break;*/
|
SET_OUTPUT(SS);
|
||||||
#endif
|
// Intentionally no break, we might have more than one sensor type.
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef TEMP_THERMISTOR
|
#ifdef TEMP_THERMISTOR
|
||||||
// handled by analog_init()
|
// handled by analog_init()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue