HAL compatible pinsDebug & misc

Re-ARM has been tested.  AVR has not been tested.

1) moved all cpu specific items to files in the low level HAL directory
for that CPU (pinDebug_Re-ARM.h & pinsDebug_AVR_8_bit.h

2) added pinsDebug.h to the top level directory

3) modified HAL_pinsDebug.h to select the correct support file for the
selected CPU

4) Patched sanitycheck to stop throwing false errors.  A long term
solution will be done

5) misc changes & bug fixes
arduino.cpp - included macros.h to fix a missing definition
pinmap_re-arm.h - removed a duplicated line.
pinmapping.h - changed from "ENABLED" to "defined" to fix a compile
error

======================================================================

split SanityCheck up, improve pinsDebug system

======================================================================

switch to latest pins_RAMPS_RE_ARM.h
This commit is contained in:
Bob-the-Kuhn
2017-07-31 01:31:14 -05:00
committed by Scott Lahteine
parent 32e759c928
commit 84a11cfedc
17 changed files with 1157 additions and 440 deletions

View File

@ -25,16 +25,21 @@
// do not function the same as the other Arduino extensions
//
#ifndef __PINSDEBUG_TEENSYDUINO_H__
#define __PINSDEBUG_TEENSYDUINO_H__
#undef NUM_DIGITAL_PINS
#define NUM_DIGITAL_PINS 48 // Teensy says 46 but FASTIO is 48
#define TEENSYDUINO_IDE
// "digitalPinToPort" function just returns the pin number so need to create our own.
// Can't use the name "digitalPinToPort" for our own because it interferes with the
// FAST_PWM_FAN function if we do
//digitalPinToTimer(pin) function works like Arduino but Timers are not defined
#define TIMER0B 1
#define TIMER1A 7
#define TIMER1B 8
#define TIMER1C 9
#define TIMER2A 6
#define TIMER2B 2
#define TIMER3A 5
#define TIMER3B 4
#define TIMER3C 3
// digitalPinToPort function just returns the pin number so need to create our own
#define PA 1
#define PB 2
#define PC 3
@ -42,8 +47,9 @@
#define PE 5
#define PF 6
#undef digitalPinToPort
const uint8_t PROGMEM digital_pin_to_port_PGM_Teensy[] = {
const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
PD, // 0 - PD0 - INT0 - PWM
PD, // 1 - PD1 - INT1 - PWM
PD, // 2 - PD2 - INT2 - RX
@ -94,7 +100,7 @@ const uint8_t PROGMEM digital_pin_to_port_PGM_Teensy[] = {
PE, // 47 - PE3 (not defined in teensyduino)
};
#define digitalPinToPort_Teensy(P) ( pgm_read_byte( digital_pin_to_port_PGM_Teensy + (P) ) )
#define digitalPinToPort(P) ( pgm_read_byte( digital_pin_to_port_PGM + (P) ) )
// digitalPinToBitMask(pin) is OK
@ -102,5 +108,3 @@ const uint8_t PROGMEM digital_pin_to_port_PGM_Teensy[] = {
// disable the PWMs so we can use it as is
// portModeRegister(pin) is OK
#endif // __PINSDEBUG_TEENSYDUINO_H__