From 286d5003fadab0a19ae4eddade6fcc8c1cc7a753 Mon Sep 17 00:00:00 2001 From: Daid Date: Sun, 26 Feb 2012 17:35:01 +0100 Subject: [PATCH] Fixed compiler warning for Sanguino compile --- Marlin/Sanguino/cores/arduino/pins_arduino.c | 24 +++++++++---------- Marlin/Sanguino/cores/arduino/pins_arduino.h | 6 ++--- .../Sanguino/cores/arduino/wiring_private.h | 2 +- Marlin/pins.h | 1 + 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Marlin/Sanguino/cores/arduino/pins_arduino.c b/Marlin/Sanguino/cores/arduino/pins_arduino.c index af3ba5052..d5fa6fea3 100644 --- a/Marlin/Sanguino/cores/arduino/pins_arduino.c +++ b/Marlin/Sanguino/cores/arduino/pins_arduino.c @@ -67,28 +67,28 @@ const uint8_t PROGMEM port_to_mode_PGM[] = { NOT_A_PORT, - (uint8_t) &DDRA, - (uint8_t) &DDRB, - (uint8_t) &DDRC, - (uint8_t) &DDRD, + (uint8_t) (uint16_t) &DDRA, + (uint8_t) (uint16_t) &DDRB, + (uint8_t) (uint16_t) &DDRC, + (uint8_t) (uint16_t) &DDRD, }; const uint8_t PROGMEM port_to_output_PGM[] = { NOT_A_PORT, - (uint8_t) &PORTA, - (uint8_t) &PORTB, - (uint8_t) &PORTC, - (uint8_t) &PORTD, + (uint8_t) (uint16_t) &PORTA, + (uint8_t) (uint16_t) &PORTB, + (uint8_t) (uint16_t) &PORTC, + (uint8_t) (uint16_t) &PORTD, }; const uint8_t PROGMEM port_to_input_PGM[] = { NOT_A_PORT, - (uint8_t) &PINA, - (uint8_t) &PINB, - (uint8_t) &PINC, - (uint8_t) &PIND, + (uint8_t) (uint16_t) &PINA, + (uint8_t) (uint16_t) &PINB, + (uint8_t) (uint16_t) &PINC, + (uint8_t) (uint16_t) &PIND, }; const uint8_t PROGMEM digital_pin_to_port_PGM[] = diff --git a/Marlin/Sanguino/cores/arduino/pins_arduino.h b/Marlin/Sanguino/cores/arduino/pins_arduino.h index e0b7add86..fd7ee5c8c 100644 --- a/Marlin/Sanguino/cores/arduino/pins_arduino.h +++ b/Marlin/Sanguino/cores/arduino/pins_arduino.h @@ -58,8 +58,8 @@ extern const uint8_t PROGMEM digital_pin_to_timer_PGM[]; #define digitalPinToBitMask(P) ( pgm_read_byte( digital_pin_to_bit_mask_PGM + (P) ) ) #define digitalPinToTimer(P) ( pgm_read_byte( digital_pin_to_timer_PGM + (P) ) ) #define analogInPinToBit(P) (P) -#define portOutputRegister(P) ( (volatile uint8_t *)( pgm_read_byte( port_to_output_PGM + (P))) ) -#define portInputRegister(P) ( (volatile uint8_t *)( pgm_read_byte( port_to_input_PGM + (P))) ) -#define portModeRegister(P) ( (volatile uint8_t *)( pgm_read_byte( port_to_mode_PGM + (P))) ) +#define portOutputRegister(P) ( (volatile uint8_t *)( (uint16_t) pgm_read_byte( port_to_output_PGM + (P))) ) +#define portInputRegister(P) ( (volatile uint8_t *)( (uint16_t) pgm_read_byte( port_to_input_PGM + (P))) ) +#define portModeRegister(P) ( (volatile uint8_t *)( (uint16_t) pgm_read_byte( port_to_mode_PGM + (P))) ) #endif diff --git a/Marlin/Sanguino/cores/arduino/wiring_private.h b/Marlin/Sanguino/cores/arduino/wiring_private.h index 56c471353..7449c76ac 100644 --- a/Marlin/Sanguino/cores/arduino/wiring_private.h +++ b/Marlin/Sanguino/cores/arduino/wiring_private.h @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include diff --git a/Marlin/pins.h b/Marlin/pins.h index ebcfdd360..5d1b60611 100644 --- a/Marlin/pins.h +++ b/Marlin/pins.h @@ -539,6 +539,7 @@ * ****************************************************************************************/ #if MOTHERBOARD == 62 +#undef MOTHERBOARD #define MOTHERBOARD 6 #define SANGUINOLOLU_V_1_2 #endif