├── .gitignore ├── RCArduinoFastLib ├── RCArduinoFastLib.cpp └── RCArduinoFastLib.h ├── README.md └── example ├── .build ├── environment.pickle └── uno │ ├── Makefile │ ├── Makefile.deps │ ├── Makefile.sketch │ ├── PinChangeInt │ ├── Examples │ │ └── ByteBuffer │ │ │ └── ByteBuffer.d │ └── dependencies.d │ ├── RCArduinoFastLib │ ├── RCArduinoFastLib.d │ └── dependencies.d │ ├── arduino │ ├── CDC.d │ ├── HID.d │ ├── HardwareSerial.d │ ├── IPAddress.d │ ├── Print.d │ ├── Stream.d │ ├── Tone.d │ ├── USBCore.d │ ├── WInterrupts.d │ ├── WMath.d │ ├── WString.d │ ├── dependencies.d │ ├── main.d │ ├── new.d │ ├── wiring.d │ ├── wiring_analog.d │ ├── wiring_digital.d │ ├── wiring_pulse.d │ └── wiring_shift.d │ ├── firmware.elf │ ├── firmware.hex │ └── src │ ├── dependencies.d │ ├── sketch.cpp │ └── sketch.d ├── lib ├── .holder ├── PinChangeInt │ ├── Examples │ │ ├── ByteBuffer │ │ │ ├── ByteBuffer.cpp │ │ │ └── ByteBuffer.h │ │ ├── GetPSTR │ │ │ └── GetPSTR.h │ │ ├── PinChangeIntExample │ │ │ └── PinChangeIntExample.pde │ │ ├── PinChangeIntSpeedTest │ │ │ └── PinChangeIntSpeedTest.pde │ │ ├── PinChangeIntTest │ │ │ └── PinChangeIntTest.pde │ │ └── PinChangeIntTest2 │ │ │ └── PinChangeIntTest2.ino │ ├── PinChangeInt.h │ ├── RELEASE_NOTES │ ├── gpl.txt │ └── keywords.txt └── RCArduinoFastLib └── src └── sketch.ino /.gitignore: -------------------------------------------------------------------------------- 1 | # Object files 2 | *.o 3 | 4 | # Libraries 5 | *.lib 6 | *.a 7 | 8 | # Shared objects (inc. Windows DLLs) 9 | *.dll 10 | *.so 11 | *.so.* 12 | *.dylib 13 | 14 | # Executables 15 | *.exe 16 | *.out 17 | *.app 18 | -------------------------------------------------------------------------------- /RCArduinoFastLib/RCArduinoFastLib.cpp: -------------------------------------------------------------------------------- 1 | /***************************************************************************************************************************** 2 | // RCArduinoFastLib by DuaneB is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. 3 | // 4 | // http://rcarduino.blogspot.com 5 | // 6 | *****************************************************************************************************************************/ 7 | 8 | #include "Arduino.h" 9 | #include "RCArduinoFastLib.h" 10 | 11 | /*---------------------------------------------------------------------------------------- 12 | 13 | This is essentially a derivative of the Arduino Servo Library created by Michael Margolis 14 | 15 | As the technique is very similar to the Servo class, it can be useful to study in order 16 | to understand the servo class. 17 | 18 | What does the library do ? It uses a very inexpensive and common 4017 Counter IC 19 | To generate pulses to independently drive up to 10 servos from two Arduino Pins 20 | 21 | As previously mentioned, the library is based on the techniques used in the Arduino Servo 22 | library created by Michael Margolis. This means that the library uses Timer1 and Timer1 output 23 | compare register A. 24 | 25 | OCR1A is linked to digital pin 9 and so we use digital pin 9 to generate the clock signal 26 | for the 4017 counter. 27 | 28 | Pin 12 is used as the reset pin. 29 | 30 | */ 31 | 32 | void CRCArduinoFastServos::setup() 33 | { 34 | m_sCurrentOutputChannelA = 0; 35 | while(m_sCurrentOutputChannelA < RC_CHANNEL_OUT_COUNT) 36 | { 37 | m_ChannelOutA[m_sCurrentOutputChannelA].m_unPulseWidth = microsecondsToTicks(RCARDUINO_SERIAL_SERVO_MAX); 38 | 39 | #if defined (MORE_SERVOS_PLEASE) 40 | m_ChannelOutB[m_sCurrentOutputChannelA].m_unPulseWidth = microsecondsToTicks(RCARDUINO_SERIAL_SERVO_MAX); 41 | #endif 42 | 43 | m_sCurrentOutputChannelA++; 44 | } 45 | } 46 | 47 | 48 | // Timer1 Output Compare A interrupt service routine 49 | // call out class member function OCR1A_ISR so that we can 50 | // access out member variables 51 | ISR(TIMER1_COMPA_vect) 52 | { 53 | CRCArduinoFastServos::OCR1A_ISR(); 54 | } 55 | 56 | void CRCArduinoFastServos::OCR1A_ISR() 57 | { 58 | // If the channel number is >= 10, we need to reset the counter 59 | // and start again from zero. 60 | // to do this we pulse the reset pin of the counter 61 | // this sets output 0 of the counter high, effectivley 62 | // starting the first pulse of our first channel 63 | if(m_sCurrentOutputChannelA >= RC_CHANNEL_OUT_COUNT) 64 | { 65 | // reset our current servo/output channel to 0 66 | m_sCurrentOutputChannelA = 0; 67 | 68 | CRCArduinoFastServos::setChannelPinLowA(RC_CHANNEL_OUT_COUNT-1); 69 | } 70 | else 71 | { 72 | CRCArduinoFastServos::setChannelPinLowA(m_sCurrentOutputChannelA-1); 73 | } 74 | 75 | CRCArduinoFastServos::setCurrentChannelPinHighA(); 76 | 77 | // set the duration of the output pulse 78 | CRCArduinoFastServos::setOutputTimerForPulseDurationA(); 79 | 80 | // done with this channel so move on. 81 | m_sCurrentOutputChannelA++; 82 | } 83 | 84 | void CRCArduinoFastServos::setChannelPinLowA(uint8_t sChannel) 85 | { 86 | volatile CPortPin *pPortPin = m_ChannelOutA + sChannel; 87 | 88 | if(pPortPin->m_sPinMask) 89 | *pPortPin->m_pPort ^= pPortPin->m_sPinMask; 90 | } 91 | 92 | void CRCArduinoFastServos::setCurrentChannelPinHighA() 93 | { 94 | volatile CPortPin *pPortPin = m_ChannelOutA + m_sCurrentOutputChannelA; 95 | 96 | if(pPortPin->m_sPinMask) 97 | *pPortPin->m_pPort |= pPortPin->m_sPinMask; 98 | } 99 | 100 | // After we set an output pin high, we need to set the timer to comeback for the end of the pulse 101 | void CRCArduinoFastServos::setOutputTimerForPulseDurationA() 102 | { 103 | OCR1A = TCNT1 + m_ChannelOutA[m_sCurrentOutputChannelA].m_unPulseWidth; 104 | } 105 | 106 | #if defined(MORE_SERVOS_PLEASE) 107 | // Timer1 Output Compare B interrupt service routine 108 | // call out class member function OCR1B_ISR so that we can 109 | // access out member variables 110 | ISR(TIMER1_COMPB_vect) 111 | { 112 | CRCArduinoFastServos::OCR1B_ISR(); 113 | } 114 | 115 | void CRCArduinoFastServos::OCR1B_ISR() 116 | { 117 | if(m_sCurrentOutputChannelB >= RC_CHANNEL_OUT_COUNT) 118 | { 119 | // reset our current servo/output channel to 0 120 | m_sCurrentOutputChannelB = 0; 121 | CRCArduinoFastServos::setChannelPinLowB(RC_CHANNEL_OUT_COUNT-1); 122 | } 123 | else 124 | { 125 | CRCArduinoFastServos::setChannelPinLowB(m_sCurrentOutputChannelB-1); 126 | } 127 | 128 | CRCArduinoFastServos::setCurrentChannelPinHighB(); 129 | 130 | // set the duration of the output pulse 131 | CRCArduinoFastServos::setOutputTimerForPulseDurationB(); 132 | 133 | // done with this channel so move on. 134 | m_sCurrentOutputChannelB++; 135 | } 136 | 137 | void CRCArduinoFastServos::setChannelPinLowB(uint8_t sChannel) 138 | { 139 | volatile CPortPin *pPortPin = m_ChannelOutB + sChannel; 140 | 141 | if(pPortPin->m_sPinMask) 142 | *pPortPin->m_pPort ^= pPortPin->m_sPinMask; 143 | } 144 | 145 | void CRCArduinoFastServos::setCurrentChannelPinHighB() 146 | { 147 | volatile CPortPin *pPortPin = m_ChannelOutB + m_sCurrentOutputChannelB; 148 | 149 | if(pPortPin->m_sPinMask) 150 | *pPortPin->m_pPort |= pPortPin->m_sPinMask; 151 | } 152 | 153 | 154 | 155 | // After we set an output pin high, we need to set the timer to comeback for the end of the pulse 156 | void CRCArduinoFastServos::setOutputTimerForPulseDurationB() 157 | { 158 | OCR1B = TCNT1 + m_ChannelOutB[m_sCurrentOutputChannelB].m_unPulseWidth; 159 | } 160 | #endif 161 | 162 | // updates a channel to a new value, the class will continue to pulse the channel 163 | // with this value for the lifetime of the sketch or until writeChannel is called 164 | // again to update the value 165 | void CRCArduinoFastServos::writeMicroseconds(uint8_t nChannel,uint16_t unMicroseconds) 166 | { 167 | // dont allow a write to a non existent channel 168 | if(nChannel > RCARDUINO_MAX_SERVOS) 169 | return; 170 | 171 | // constraint the value just in case 172 | unMicroseconds = constrain(unMicroseconds,RCARDUINO_SERIAL_SERVO_MIN,RCARDUINO_SERIAL_SERVO_MAX); 173 | 174 | #if defined(MORE_SERVOS_PLEASE) 175 | if(nChannel >= RC_CHANNEL_OUT_COUNT) 176 | { 177 | unMicroseconds = microsecondsToTicks(unMicroseconds); 178 | unsigned char sChannel = nChannel-RC_CHANNEL_OUT_COUNT; 179 | // disable interrupts while we update the multi byte value output value 180 | uint8_t sreg = SREG; 181 | cli(); 182 | 183 | m_ChannelOutB[sChannel].m_unPulseWidth = unMicroseconds; 184 | 185 | // enable interrupts 186 | SREG = sreg; 187 | return; 188 | } 189 | #endif 190 | 191 | unMicroseconds = microsecondsToTicks(unMicroseconds); 192 | 193 | // disable interrupts while we update the multi byte value output value 194 | uint8_t sreg = SREG; 195 | cli(); 196 | 197 | m_ChannelOutA[nChannel].m_unPulseWidth = unMicroseconds; 198 | 199 | // enable interrupts 200 | SREG = sreg; 201 | } 202 | 203 | uint16_t CRCArduinoFastServos::ticksToMicroseconds(uint16_t unTicks) 204 | { 205 | return unTicks / 2; 206 | } 207 | 208 | uint16_t CRCArduinoFastServos::microsecondsToTicks(uint16_t unMicroseconds) 209 | { 210 | return unMicroseconds * 2; 211 | } 212 | 213 | void CRCArduinoFastServos::attach(uint8_t sChannel,uint8_t sPin) 214 | { 215 | if(sChannel >= RCARDUINO_MAX_SERVOS) 216 | return; 217 | 218 | #if defined(MORE_SERVOS_PLEASE) 219 | if(sChannel >= RC_CHANNEL_OUT_COUNT) 220 | { 221 | // disable interrupts while we update the multi byte value output value 222 | uint8_t sreg = SREG; 223 | cli(); 224 | 225 | m_ChannelOutB[sChannel-RC_CHANNEL_OUT_COUNT].m_unPulseWidth = microsecondsToTicks(RCARDUINO_SERIAL_SERVO_DEFAULT); 226 | m_ChannelOutB[sChannel-RC_CHANNEL_OUT_COUNT].m_pPort = getPortFromPin(sPin); 227 | m_ChannelOutB[sChannel-RC_CHANNEL_OUT_COUNT].m_sPinMask = getPortPinMaskFromPin(sPin); 228 | // enable interrupts 229 | SREG = sreg; 230 | pinMode(sPin,OUTPUT); 231 | return; 232 | } 233 | #endif 234 | 235 | // disable interrupts while we update the multi byte value output value 236 | uint8_t sreg = SREG; 237 | cli(); 238 | 239 | m_ChannelOutA[sChannel].m_unPulseWidth = microsecondsToTicks(RCARDUINO_SERIAL_SERVO_DEFAULT); 240 | m_ChannelOutA[sChannel].m_pPort = getPortFromPin(sPin); 241 | m_ChannelOutA[sChannel].m_sPinMask = getPortPinMaskFromPin(sPin); 242 | 243 | // enable interrupts 244 | SREG = sreg; 245 | 246 | pinMode(sPin,OUTPUT); 247 | } 248 | 249 | // this allows us to run different refresh frequencies on channel A and B 250 | // for example servos at a 70Hz rate on A and ESCs at 250Hz on B 251 | void CRCArduinoFastServos::setFrameSpaceA(uint8_t sChannel,uint16_t unMicroseconds) 252 | { 253 | // disable interrupts while we update the multi byte value output value 254 | uint8_t sreg = SREG; 255 | cli(); 256 | 257 | m_ChannelOutA[sChannel].m_unPulseWidth = microsecondsToTicks(unMicroseconds); 258 | m_ChannelOutA[sChannel].m_pPort = 0; 259 | m_ChannelOutA[sChannel].m_sPinMask = 0; 260 | 261 | // enable interrupts 262 | SREG = sreg; 263 | } 264 | 265 | #if defined (MORE_SERVOS_PLEASE) 266 | void CRCArduinoFastServos::setFrameSpaceB(uint8_t sChannel,uint16_t unMicroseconds) 267 | { 268 | // disable interrupts while we update the multi byte value output value 269 | uint8_t sreg = SREG; 270 | cli(); 271 | 272 | m_ChannelOutB[sChannel].m_unPulseWidth = microsecondsToTicks(unMicroseconds); 273 | m_ChannelOutB[sChannel].m_pPort = 0; 274 | m_ChannelOutB[sChannel].m_sPinMask = 0; 275 | 276 | // enable interrupts 277 | SREG = sreg; 278 | } 279 | #endif 280 | // Easy to optimise this, but lets keep it readable instead, its short enough. 281 | volatile uint8_t* CRCArduinoFastServos::getPortFromPin(uint8_t sPin) 282 | { 283 | volatile uint8_t* pPort = RC_CHANNELS_NOPORT; 284 | 285 | if(sPin <= 7) 286 | { 287 | pPort = &PORTD; 288 | } 289 | else if(sPin <= 13) 290 | { 291 | pPort = &PORTB; 292 | } 293 | else if(sPin <= A5) // analog input pin 5 294 | { 295 | pPort = &PORTC; 296 | } 297 | 298 | return pPort; 299 | } 300 | 301 | // Easy to optimise this, but lets keep it readable instead, its short enough. 302 | uint8_t CRCArduinoFastServos::getPortPinMaskFromPin(uint8_t sPin) 303 | { 304 | uint8_t sPortPinMask = RC_CHANNELS_NOPIN; 305 | 306 | if(sPin <= A5) 307 | { 308 | if(sPin <= 7) 309 | { 310 | sPortPinMask = (1 << sPin); 311 | } 312 | else if(sPin <= 13) 313 | { 314 | sPin -= 8; 315 | sPortPinMask = (1 << sPin); 316 | } 317 | else if(sPin <= A5) 318 | { 319 | sPin -= A0; 320 | sPortPinMask = (1 << sPin); 321 | } 322 | } 323 | 324 | return sPortPinMask; 325 | } 326 | 327 | void CRCArduinoFastServos::begin() 328 | { 329 | TCNT1 = 0; // clear the timer count 330 | 331 | // Initilialise Timer1 332 | TCCR1A = 0; // normal counting mode 333 | TCCR1B = 2; // set prescaler of 8 = 1 tick = 0.5us (see ATmega328 datasheet pgs. 134-135) 334 | 335 | // ENABLE TIMER1 OCR1A INTERRUPT to enabled the first bank (A) of ten servos 336 | TIFR1 |= _BV(OCF1A); // clear any pending interrupts; 337 | TIMSK1 |= _BV(OCIE1A) ; // enable the output compare interrupt 338 | 339 | #if defined(MORE_SERVOS_PLEASE) 340 | 341 | // ENABLE TIMER1 OCR1B INTERRUPT to enable the second bank (B) of 10 servos 342 | TIFR1 |= _BV(OCF1B); // clear any pending interrupts; 343 | TIMSK1 |= _BV(OCIE1B) ; // enable the output compare interrupt 344 | 345 | #endif 346 | 347 | OCR1A = TCNT1 + 4000; // Start in two milli seconds 348 | 349 | for(uint8_t sServo = 0;sServo MAXIMUM_PULSE_SPACE) 406 | { 407 | forceResynch(); 408 | } 409 | else 410 | { 411 | // its a good signal, lets record it and move onto the next channel 412 | m_unChannelSignalIn[m_sCurrentInputChannel++] = ulInterval; 413 | } 414 | } 415 | // record the current time 416 | m_unChannelRiseTime = TCNT1; 417 | } 418 | 419 | // if we force a resynch we set the channel 420 | void CRCArduinoPPMChannels::forceResynch() 421 | { 422 | m_sCurrentInputChannel = RC_CHANNEL_IN_COUNT; 423 | 424 | if(m_sOutOfSynchErrorCounter<255) 425 | m_sOutOfSynchErrorCounter++; 426 | } 427 | 428 | uint8_t CRCArduinoPPMChannels::getSynchErrorCounter() 429 | { 430 | uint8_t sErrors = m_sOutOfSynchErrorCounter; 431 | 432 | m_sOutOfSynchErrorCounter = 0; 433 | 434 | return sErrors; 435 | } 436 | 437 | uint16_t CRCArduinoPPMChannels::getChannel(uint8_t sChannel) 438 | { 439 | uint16_t ulPulse; 440 | unsigned char sreg = SREG; 441 | 442 | cli(); 443 | 444 | ulPulse = m_unChannelSignalIn[sChannel]; 445 | m_unChannelSignalIn[sChannel] = 0; 446 | 447 | SREG = sreg; 448 | 449 | return ulPulse>>1; 450 | } 451 | -------------------------------------------------------------------------------- /RCArduinoFastLib/RCArduinoFastLib.h: -------------------------------------------------------------------------------- 1 | /*****************************************************************************************************************************/ 2 | // RCArduinoFastLib by DuaneB is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. 3 | // 4 | // http://rcarduino.blogspot.com 5 | // 6 | /*****************************************************************************************************************************/ 7 | 8 | #include "Arduino.h" 9 | 10 | // COMMENT OR UNCOMMENT THIS LINE TO ENABLE THE SECOND BANK OF SERVOS 11 | //#define MORE_SERVOS_PLEASE 1 12 | 13 | // the first bank of servos uses OC1A - this will disable PWM on digital pin 9 - a small price for 10 fast and smooth servos 14 | // the second bank of servos uses OC1B - this will disable PWM on digital pin 10 - a small price for 10 more fast and smooth servos 15 | 16 | // The library blindly pulses all ten servos one and after another 17 | // If you change the RC_CHANNEL_OUT_COUNT to 4 servos, the library will pulse them more frequently than 18 | // it can ten - 19 | // 10 servos at 1500us = 15ms = 66Hz 20 | // 4 Servos at 1500us = 6ms = 166Hz 21 | // if you wanted to go even higher, run two servos on each timer 22 | // 2 Servos at 1500us = 3ms = 333Hz 23 | // 24 | // You might not want a high refresh rate though, so the setFrameSpace function is provided for you to 25 | // add a pause before the library begins its next run through the servos 26 | // for 50 hz, the pause should be to (20,000 - (RC_CHANNEL_OUT_COUNT * 2000)) 27 | 28 | // Change to set the number of servos/ESCs 29 | #define RC_CHANNEL_OUT_COUNT 4 30 | 31 | #if defined (MORE_SERVOS_PLEASE) 32 | #define RCARDUINO_MAX_SERVOS (RC_CHANNEL_OUT_COUNT*2) 33 | #else 34 | #define RCARDUINO_MAX_SERVOS (RC_CHANNEL_OUT_COUNT) 35 | #endif 36 | 37 | // Minimum and Maximum servo pulse widths, you could change these, 38 | // Check the servo library and use that range if you prefer 39 | #define RCARDUINO_SERIAL_SERVO_MIN 1000 40 | #define RCARDUINO_SERIAL_SERVO_MAX 2000 41 | #define RCARDUINO_SERIAL_SERVO_DEFAULT 1500 42 | 43 | #define RC_CHANNELS_NOPORT 0 44 | #define RC_CHANNELS_PORTB 1 45 | #define RC_CHANNELS_PORTC 2 46 | #define RC_CHANNELS_PORTD 3 47 | #define RC_CHANNELS_NOPIN 255 48 | 49 | ////////////////////////////////////////////////////////////////////////////////////////////////////////// 50 | // 51 | // CRCArduinoFastServos 52 | // 53 | // A class for generating signals in combination with a 4017 Counter 54 | // 55 | // Output upto 10 Servo channels using just digital pins 9 and 12 56 | // 9 generates the clock signal and must be connected to the clock pin of the 4017 57 | // 12 generates the reset pulse and must be connected to the master reset pin of the 4017 58 | // 59 | // The class uses Timer1, as this prevents use with the servo library 60 | // The class uses pins 9 and 12 61 | // The class does not adjust the servo frame to account for variations in pulse width, 62 | // on the basis that many RC transmitters and receivers designed specifically to operate with servos 63 | // output signals between 50 and 100hz, this is the same range as the library 64 | // 65 | // Use of an additional pin would provide for error detection, however using pin 12 to pulse master reset 66 | // at the end of every frame means that the system is essentially self correcting 67 | // 68 | // Note 69 | // This is a simplified derivative of the Arduino Servo Library created by Michael Margolis 70 | // The simplification has been possible by moving some of the flexibility provided by the Servo library 71 | // from software to hardware. 72 | // 73 | //////////////////////////////////////////////////////////////////////////////////////////////////////////// 74 | 75 | 76 | class CRCArduinoFastServos 77 | { 78 | public: 79 | static void setup(); 80 | 81 | // configures timer1 82 | static void begin(); 83 | 84 | // called by the timer interrupt service routine, see the cpp file for details. 85 | static void OCR1A_ISR(); 86 | 87 | #if defined(MORE_SERVOS_PLEASE) 88 | static void OCR1B_ISR(); 89 | #endif 90 | 91 | // called to set the pulse width for a specific channel, pulse widths are in microseconds - degrees are for wimps ! 92 | static void attach(uint8_t nChannel,uint8_t nPin); 93 | static void writeMicroseconds(uint8_t nChannel,uint16_t nMicroseconds); 94 | static void setFrameSpaceA(uint8_t sChannel,uint16_t unMicroseconds); 95 | static void setFrameSpaceB(uint8_t sChannel,uint16_t unMicroseconds); 96 | 97 | protected: 98 | class CPortPin 99 | { 100 | public: 101 | //uint8_t m_sPort; 102 | volatile unsigned char *m_pPort; 103 | uint8_t m_sPinMask; 104 | uint16_t m_unPulseWidth; 105 | }; 106 | 107 | // this sets the value of the timer1 output compare register to a point in the future 108 | // based on the required pulse with for the current servo 109 | static void setOutputTimerForPulseDurationA() __attribute__((always_inline)); 110 | 111 | 112 | static void setChannelPinLowA(uint8_t sChannel) __attribute__((always_inline)); 113 | static void setCurrentChannelPinHighA(); 114 | 115 | // Easy to optimise this, but lets keep it readable instead, its short enough. 116 | static volatile uint8_t* getPortFromPin(uint8_t sPin) __attribute__((always_inline)); 117 | static uint8_t getPortPinMaskFromPin(uint8_t sPin) __attribute__((always_inline)); 118 | 119 | // Records the current output channel values in timer ticks 120 | // Manually set by calling writeChannel, the function adjusts from 121 | // user supplied micro seconds to timer ticks 122 | volatile static CPortPin m_ChannelOutA[RC_CHANNEL_OUT_COUNT]; 123 | // current output channel, used by the timer ISR to track which channel is being generated 124 | static uint8_t m_sCurrentOutputChannelA; 125 | 126 | #if defined(MORE_SERVOS_PLEASE) 127 | // Optional channel B for servo number 10 to 19 128 | volatile static CPortPin m_ChannelOutB[RC_CHANNEL_OUT_COUNT]; 129 | static uint8_t m_sCurrentOutputChannelB; 130 | static void setOutputTimerForPulseDurationB(); 131 | 132 | static void setChannelPinLowB(uint8_t sChannel) __attribute__((always_inline)); 133 | static void setCurrentChannelPinHighB() __attribute__((always_inline)); 134 | #endif 135 | 136 | // two helper functions to convert between timer values and microseconds 137 | static uint16_t ticksToMicroseconds(uint16_t unTicks) __attribute__((always_inline)); 138 | static uint16_t microsecondsToTicks(uint16_t unMicroseconds) __attribute__((always_inline)); 139 | }; 140 | 141 | // Change to set the number of channels in PPM Input stream 142 | #define RC_CHANNEL_IN_COUNT 3 143 | // two ticks per us, 3000 us * 2 ticks = 6000 minimum frame space 144 | #define MINIMUM_FRAME_SPACE 6000 145 | #define MAXIMUM_PULSE_SPACE 5000 146 | 147 | class CRCArduinoPPMChannels 148 | { 149 | public: 150 | static void begin(); 151 | static void INT0ISR(); 152 | static uint16_t getChannel(uint8_t nChannel); 153 | static uint8_t getSynchErrorCounter(); 154 | 155 | protected: 156 | static void forceResynch(); 157 | 158 | static volatile uint16_t m_unChannelSignalIn[RC_CHANNEL_IN_COUNT]; 159 | static uint8_t m_sCurrentInputChannel; 160 | 161 | static uint16_t m_unChannelRiseTime; 162 | static volatile uint8_t m_sOutOfSynchErrorCounter; 163 | }; 164 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | RCArduinoFastLib 2 | ================ 3 | 4 | 6 channel RC input for Arduino 5 | 6 | Source: http://rcarduino.blogspot.com 7 | 8 | -------------------------------------------------------------------------------- /example/.build/environment.pickle: -------------------------------------------------------------------------------- 1 | (lp0 2 | (S'elfflags' 3 | p1 4 | ccopy_reg 5 | _reconstructor 6 | p2 7 | (cino.utils 8 | SpaceList 9 | p3 10 | c__builtin__ 11 | list 12 | p4 13 | (lp5 14 | S'-Os' 15 | p6 16 | aS'-Wl,--gc-sections' 17 | p7 18 | aS'-mmcu=atmega328p' 19 | p8 20 | atp9 21 | Rp10 22 | tp11 23 | a(S'version.txt' 24 | p12 25 | S'/usr/share/arduino/lib/version.txt' 26 | p13 27 | tp14 28 | a(S'used_libs' 29 | p15 30 | (lp16 31 | S'lib/PinChangeInt' 32 | p17 33 | aS'lib/RCArduinoFastLib' 34 | p18 35 | aS'/usr/share/arduino/hardware/arduino/cores/arduino' 36 | p19 37 | atp20 38 | a(S'cc' 39 | p21 40 | S'/usr/bin/avr-gcc' 41 | p22 42 | tp23 43 | a(S'cflags' 44 | p24 45 | g2 46 | (g3 47 | g4 48 | (lp25 49 | g8 50 | aS'-ffunction-sections' 51 | p26 52 | aS'-fdata-sections' 53 | p27 54 | aS'-g' 55 | p28 56 | ag6 57 | aS'-w' 58 | p29 59 | aS'-DF_CPU=16000000L' 60 | p30 61 | aS'-DARDUINO=100' 62 | p31 63 | aS'-I/usr/share/arduino/hardware/arduino/cores/arduino' 64 | p32 65 | aS'-I/usr/share/arduino/hardware/arduino/variants/standard' 66 | p33 67 | aS'-Ilib/PinChangeInt' 68 | p34 69 | aS'-Ilib/PinChangeInt/Examples' 70 | p35 71 | aS'-Ilib/PinChangeInt/Examples/ByteBuffer' 72 | p36 73 | aS'-Ilib/PinChangeInt/Examples/GetPSTR' 74 | p37 75 | aS'-Ilib/PinChangeInt/Examples/PinChangeIntSpeedTest' 76 | p38 77 | aS'-Ilib/PinChangeInt/Examples/PinChangeIntTest2' 78 | p39 79 | aS'-Ilib/PinChangeInt/Examples/PinChangeIntTest' 80 | p40 81 | aS'-Ilib/PinChangeInt/Examples/PinChangeIntExample' 82 | p41 83 | aS'-Ilib/RCArduinoFastLib' 84 | p42 85 | aS'-I/usr/share/arduino/hardware/arduino/cores/arduino' 86 | p43 87 | atp44 88 | Rp45 89 | tp46 90 | a(S'build_dir' 91 | p47 92 | S'.build/uno' 93 | p48 94 | tp49 95 | a(S'arduino_core_dir' 96 | p50 97 | g19 98 | tp51 99 | a(S'boards.txt' 100 | p52 101 | S'/usr/share/arduino/hardware/arduino/boards.txt' 102 | p53 103 | tp54 104 | a(S'cxxflags' 105 | p55 106 | g2 107 | (g3 108 | g4 109 | (lp56 110 | S'-fno-exceptions' 111 | p57 112 | atp58 113 | Rp59 114 | tp60 115 | a(S'arduino_variants_dir' 116 | p61 117 | S'/usr/share/arduino/hardware/arduino/variants' 118 | p62 119 | tp63 120 | a(S'ar' 121 | p64 122 | S'/usr/bin/avr-ar' 123 | p65 124 | tp66 125 | a(S'names' 126 | p67 127 | (dp68 128 | S'cpp' 129 | p69 130 | S'%s.cpp' 131 | p70 132 | sS'obj' 133 | p71 134 | S'%s.o' 135 | p72 136 | sS'deps' 137 | p73 138 | S'%s.d' 139 | p74 140 | sS'lib' 141 | p75 142 | S'lib%s.a' 143 | p76 144 | stp77 145 | a(S'deps' 146 | p78 147 | g2 148 | (g3 149 | g4 150 | (lp79 151 | S'.build/uno/src/dependencies.d' 152 | p80 153 | aS'.build/uno/arduino/dependencies.d' 154 | p81 155 | aS'.build/uno/PinChangeInt/dependencies.d' 156 | p82 157 | aS'.build/uno/RCArduinoFastLib/dependencies.d' 158 | p83 159 | atp84 160 | Rp85 161 | tp86 162 | a(S'arduino_libraries_dir' 163 | p87 164 | S'/usr/share/arduino/libraries' 165 | p88 166 | tp89 167 | a(S'arduino_lib_version' 168 | p90 169 | g2 170 | (cino.environment 171 | Version 172 | p91 173 | c__builtin__ 174 | tuple 175 | p92 176 | (I1 177 | I0 178 | tp93 179 | tp94 180 | Rp95 181 | tp96 182 | a(S'objcopy' 183 | p97 184 | S'/usr/bin/avr-objcopy' 185 | p98 186 | tp99 187 | a(S'board_models' 188 | p100 189 | cino.environment 190 | BoardModels 191 | p101 192 | ((lp102 193 | (lp103 194 | S'uno' 195 | p104 196 | a(dp105 197 | S'bootloader' 198 | p106 199 | (dp107 200 | S'extended_fuses' 201 | p108 202 | S'0x05' 203 | p109 204 | sS'high_fuses' 205 | p110 206 | S'0xde' 207 | p111 208 | sS'low_fuses' 209 | p112 210 | S'0xff' 211 | p113 212 | sS'lock_bits' 213 | p114 214 | S'0x0F' 215 | p115 216 | sS'file' 217 | p116 218 | S'optiboot_atmega328.hex' 219 | p117 220 | sS'path' 221 | p118 222 | S'optiboot' 223 | p119 224 | sS'unlock_bits' 225 | p120 226 | S'0x3F' 227 | p121 228 | ssS'upload' 229 | p122 230 | (dp123 231 | S'protocol' 232 | p124 233 | S'arduino' 234 | p125 235 | sS'maximum_size' 236 | p126 237 | S'32256' 238 | p127 239 | sS'speed' 240 | p128 241 | S'115200' 242 | p129 243 | ssS'build' 244 | p130 245 | (dp131 246 | S'core' 247 | p132 248 | S'arduino' 249 | p133 250 | sS'mcu' 251 | p134 252 | S'atmega328p' 253 | p135 254 | sS'f_cpu' 255 | p136 256 | S'16000000L' 257 | p137 258 | sS'variant' 259 | p138 260 | S'standard' 261 | p139 262 | ssS'name' 263 | p140 264 | S'Arduino Uno' 265 | p141 266 | saa(lp142 267 | S'atmega328' 268 | p143 269 | a(dp144 270 | S'bootloader' 271 | p145 272 | (dp146 273 | S'extended_fuses' 274 | p147 275 | S'0x05' 276 | p148 277 | sS'high_fuses' 278 | p149 279 | S'0xDA' 280 | p150 281 | sS'low_fuses' 282 | p151 283 | S'0xFF' 284 | p152 285 | sS'lock_bits' 286 | p153 287 | S'0x0F' 288 | p154 289 | sS'file' 290 | p155 291 | S'ATmegaBOOT_168_atmega328.hex' 292 | p156 293 | sS'path' 294 | p157 295 | S'atmega' 296 | p158 297 | sS'unlock_bits' 298 | p159 299 | S'0x3F' 300 | p160 301 | ssS'upload' 302 | p161 303 | (dp162 304 | S'protocol' 305 | p163 306 | S'arduino' 307 | p164 308 | sS'maximum_size' 309 | p165 310 | S'30720' 311 | p166 312 | sS'speed' 313 | p167 314 | S'57600' 315 | p168 316 | ssS'build' 317 | p169 318 | (dp170 319 | S'core' 320 | p171 321 | S'arduino' 322 | p172 323 | sS'mcu' 324 | p173 325 | S'atmega328p' 326 | p174 327 | sS'f_cpu' 328 | p175 329 | S'16000000L' 330 | p176 331 | sS'variant' 332 | p177 333 | S'standard' 334 | p178 335 | ssS'name' 336 | p179 337 | S'Arduino Duemilanove w/ ATmega328' 338 | p180 339 | saa(lp181 340 | S'diecimila' 341 | p182 342 | a(dp183 343 | S'bootloader' 344 | p184 345 | (dp185 346 | S'extended_fuses' 347 | p186 348 | S'0x00' 349 | p187 350 | sS'high_fuses' 351 | p188 352 | S'0xdd' 353 | p189 354 | sS'low_fuses' 355 | p190 356 | S'0xff' 357 | p191 358 | sS'lock_bits' 359 | p192 360 | S'0x0F' 361 | p193 362 | sS'file' 363 | p194 364 | S'ATmegaBOOT_168_diecimila.hex' 365 | p195 366 | sS'path' 367 | p196 368 | S'atmega' 369 | p197 370 | sS'unlock_bits' 371 | p198 372 | S'0x3F' 373 | p199 374 | ssS'upload' 375 | p200 376 | (dp201 377 | S'protocol' 378 | p202 379 | S'arduino' 380 | p203 381 | sS'maximum_size' 382 | p204 383 | S'14336' 384 | p205 385 | sS'speed' 386 | p206 387 | S'19200' 388 | p207 389 | ssS'build' 390 | p208 391 | (dp209 392 | S'core' 393 | p210 394 | S'arduino' 395 | p211 396 | sS'mcu' 397 | p212 398 | S'atmega168' 399 | p213 400 | sS'f_cpu' 401 | p214 402 | S'16000000L' 403 | p215 404 | sS'variant' 405 | p216 406 | S'standard' 407 | p217 408 | ssS'name' 409 | p218 410 | S'Arduino Diecimila or Duemilanove w/ ATmega168' 411 | p219 412 | saa(lp220 413 | S'nano328' 414 | p221 415 | a(dp222 416 | S'bootloader' 417 | p223 418 | (dp224 419 | S'extended_fuses' 420 | p225 421 | S'0x05' 422 | p226 423 | sS'high_fuses' 424 | p227 425 | S'0xDA' 426 | p228 427 | sS'low_fuses' 428 | p229 429 | S'0xFF' 430 | p230 431 | sS'lock_bits' 432 | p231 433 | S'0x0F' 434 | p232 435 | sS'file' 436 | p233 437 | S'ATmegaBOOT_168_atmega328.hex' 438 | p234 439 | sS'path' 440 | p235 441 | S'atmega' 442 | p236 443 | sS'unlock_bits' 444 | p237 445 | S'0x3F' 446 | p238 447 | ssS'upload' 448 | p239 449 | (dp240 450 | S'protocol' 451 | p241 452 | S'arduino' 453 | p242 454 | sS'maximum_size' 455 | p243 456 | S'30720' 457 | p244 458 | sS'speed' 459 | p245 460 | S'57600' 461 | p246 462 | ssS'build' 463 | p247 464 | (dp248 465 | S'core' 466 | p249 467 | S'arduino' 468 | p250 469 | sS'mcu' 470 | p251 471 | S'atmega328p' 472 | p252 473 | sS'f_cpu' 474 | p253 475 | S'16000000L' 476 | p254 477 | sS'variant' 478 | p255 479 | S'eightanaloginputs' 480 | p256 481 | ssS'name' 482 | p257 483 | S'Arduino Nano w/ ATmega328' 484 | p258 485 | saa(lp259 486 | S'nano' 487 | p260 488 | a(dp261 489 | S'bootloader' 490 | p262 491 | (dp263 492 | S'extended_fuses' 493 | p264 494 | S'0x00' 495 | p265 496 | sS'high_fuses' 497 | p266 498 | S'0xdd' 499 | p267 500 | sS'low_fuses' 501 | p268 502 | S'0xff' 503 | p269 504 | sS'lock_bits' 505 | p270 506 | S'0x0F' 507 | p271 508 | sS'file' 509 | p272 510 | S'ATmegaBOOT_168_diecimila.hex' 511 | p273 512 | sS'path' 513 | p274 514 | S'atmega' 515 | p275 516 | sS'unlock_bits' 517 | p276 518 | S'0x3F' 519 | p277 520 | ssS'upload' 521 | p278 522 | (dp279 523 | S'protocol' 524 | p280 525 | S'arduino' 526 | p281 527 | sS'maximum_size' 528 | p282 529 | S'14336' 530 | p283 531 | sS'speed' 532 | p284 533 | S'19200' 534 | p285 535 | ssS'build' 536 | p286 537 | (dp287 538 | S'core' 539 | p288 540 | S'arduino' 541 | p289 542 | sS'mcu' 543 | p290 544 | S'atmega168' 545 | p291 546 | sS'f_cpu' 547 | p292 548 | S'16000000L' 549 | p293 550 | sS'variant' 551 | p294 552 | S'eightanaloginputs' 553 | p295 554 | ssS'name' 555 | p296 556 | S'Arduino Nano w/ ATmega168' 557 | p297 558 | saa(lp298 559 | S'mega2560' 560 | p299 561 | a(dp300 562 | S'bootloader' 563 | p301 564 | (dp302 565 | S'extended_fuses' 566 | p303 567 | S'0xFD' 568 | p304 569 | sS'high_fuses' 570 | p305 571 | S'0xD8' 572 | p306 573 | sS'low_fuses' 574 | p307 575 | S'0xFF' 576 | p308 577 | sS'lock_bits' 578 | p309 579 | S'0x0F' 580 | p310 581 | sS'file' 582 | p311 583 | S'stk500boot_v2_mega2560.hex' 584 | p312 585 | sS'path' 586 | p313 587 | S'stk500v2' 588 | p314 589 | sS'unlock_bits' 590 | p315 591 | S'0x3F' 592 | p316 593 | ssS'upload' 594 | p317 595 | (dp318 596 | S'protocol' 597 | p319 598 | S'stk500v2' 599 | p320 600 | sS'maximum_size' 601 | p321 602 | S'258048' 603 | p322 604 | sS'speed' 605 | p323 606 | S'115200' 607 | p324 608 | ssS'build' 609 | p325 610 | (dp326 611 | S'core' 612 | p327 613 | S'arduino' 614 | p328 615 | sS'mcu' 616 | p329 617 | S'atmega2560' 618 | p330 619 | sS'f_cpu' 620 | p331 621 | S'16000000L' 622 | p332 623 | sS'variant' 624 | p333 625 | S'mega' 626 | p334 627 | ssS'name' 628 | p335 629 | S'Arduino Mega 2560 or Mega ADK' 630 | p336 631 | saa(lp337 632 | S'mega' 633 | p338 634 | a(dp339 635 | S'bootloader' 636 | p340 637 | (dp341 638 | S'extended_fuses' 639 | p342 640 | S'0xF5' 641 | p343 642 | sS'high_fuses' 643 | p344 644 | S'0xDA' 645 | p345 646 | sS'low_fuses' 647 | p346 648 | S'0xFF' 649 | p347 650 | sS'lock_bits' 651 | p348 652 | S'0x0F' 653 | p349 654 | sS'file' 655 | p350 656 | S'ATmegaBOOT_168_atmega1280.hex' 657 | p351 658 | sS'path' 659 | p352 660 | S'atmega' 661 | p353 662 | sS'unlock_bits' 663 | p354 664 | S'0x3F' 665 | p355 666 | ssS'upload' 667 | p356 668 | (dp357 669 | S'protocol' 670 | p358 671 | S'arduino' 672 | p359 673 | sS'maximum_size' 674 | p360 675 | S'126976' 676 | p361 677 | sS'speed' 678 | p362 679 | S'57600' 680 | p363 681 | ssS'build' 682 | p364 683 | (dp365 684 | S'core' 685 | p366 686 | S'arduino' 687 | p367 688 | sS'mcu' 689 | p368 690 | S'atmega1280' 691 | p369 692 | sS'f_cpu' 693 | p370 694 | S'16000000L' 695 | p371 696 | sS'variant' 697 | p372 698 | S'mega' 699 | p373 700 | ssS'name' 701 | p374 702 | S'Arduino Mega (ATmega1280)' 703 | p375 704 | saa(lp376 705 | S'mini328' 706 | p377 707 | a(dp378 708 | S'bootloader' 709 | p379 710 | (dp380 711 | S'extended_fuses' 712 | p381 713 | S'0x05' 714 | p382 715 | sS'high_fuses' 716 | p383 717 | S'0xd8' 718 | p384 719 | sS'low_fuses' 720 | p385 721 | S'0xff' 722 | p386 723 | sS'lock_bits' 724 | p387 725 | S'0x0F' 726 | p388 727 | sS'file' 728 | p389 729 | S'optiboot_atmega328-Mini.hex' 730 | p390 731 | sS'path' 732 | p391 733 | S'optiboot' 734 | p392 735 | sS'unlock_bits' 736 | p393 737 | S'0x3F' 738 | p394 739 | ssS'upload' 740 | p395 741 | (dp396 742 | S'protocol' 743 | p397 744 | S'stk500' 745 | p398 746 | sS'maximum_size' 747 | p399 748 | S'28672' 749 | p400 750 | sS'speed' 751 | p401 752 | S'115200' 753 | p402 754 | ssS'build' 755 | p403 756 | (dp404 757 | S'core' 758 | p405 759 | S'arduino' 760 | p406 761 | sS'mcu' 762 | p407 763 | S'atmega328p' 764 | p408 765 | sS'f_cpu' 766 | p409 767 | S'16000000L' 768 | p410 769 | sS'variant' 770 | p411 771 | S'eightanaloginputs' 772 | p412 773 | ssS'name' 774 | p413 775 | S'Arduino Mini w/ ATmega328' 776 | p414 777 | saa(lp415 778 | S'mini' 779 | p416 780 | a(dp417 781 | S'bootloader' 782 | p418 783 | (dp419 784 | S'extended_fuses' 785 | p420 786 | S'0x00' 787 | p421 788 | sS'high_fuses' 789 | p422 790 | S'0xdd' 791 | p423 792 | sS'low_fuses' 793 | p424 794 | S'0xff' 795 | p425 796 | sS'lock_bits' 797 | p426 798 | S'0x0F' 799 | p427 800 | sS'file' 801 | p428 802 | S'ATmegaBOOT_168_ng.hex' 803 | p429 804 | sS'path' 805 | p430 806 | S'atmega' 807 | p431 808 | sS'unlock_bits' 809 | p432 810 | S'0x3F' 811 | p433 812 | ssS'upload' 813 | p434 814 | (dp435 815 | S'protocol' 816 | p436 817 | S'arduino' 818 | p437 819 | sS'maximum_size' 820 | p438 821 | S'14336' 822 | p439 823 | sS'speed' 824 | p440 825 | S'19200' 826 | p441 827 | ssS'build' 828 | p442 829 | (dp443 830 | S'core' 831 | p444 832 | S'arduino' 833 | p445 834 | sS'mcu' 835 | p446 836 | S'atmega168' 837 | p447 838 | sS'f_cpu' 839 | p448 840 | S'16000000L' 841 | p449 842 | sS'variant' 843 | p450 844 | S'eightanaloginputs' 845 | p451 846 | ssS'name' 847 | p452 848 | S'Arduino Mini w/ ATmega168' 849 | p453 850 | saa(lp454 851 | S'ethernet' 852 | p455 853 | a(dp456 854 | S'bootloader' 855 | p457 856 | (dp458 857 | S'extended_fuses' 858 | p459 859 | S'0x05' 860 | p460 861 | sS'high_fuses' 862 | p461 863 | S'0xde' 864 | p462 865 | sS'low_fuses' 866 | p463 867 | S'0xff' 868 | p464 869 | sS'lock_bits' 870 | p465 871 | S'0x0F' 872 | p466 873 | sS'file' 874 | p467 875 | S'optiboot_atmega328.hex' 876 | p468 877 | sS'path' 878 | p469 879 | S'optiboot' 880 | p470 881 | sS'unlock_bits' 882 | p471 883 | S'0x3F' 884 | p472 885 | ssS'upload' 886 | p473 887 | (dp474 888 | S'protocol' 889 | p475 890 | S'arduino' 891 | p476 892 | sS'maximum_size' 893 | p477 894 | S'32256' 895 | p478 896 | sS'speed' 897 | p479 898 | S'115200' 899 | p480 900 | ssS'build' 901 | p481 902 | (dp482 903 | S'variant' 904 | p483 905 | S'standard' 906 | p484 907 | sS'mcu' 908 | p485 909 | S'atmega328p' 910 | p486 911 | sS'f_cpu' 912 | p487 913 | S'16000000L' 914 | p488 915 | sS'core' 916 | p489 917 | S'arduino' 918 | p490 919 | ssS'name' 920 | p491 921 | S'Arduino Ethernet' 922 | p492 923 | saa(lp493 924 | S'fio' 925 | p494 926 | a(dp495 927 | S'bootloader' 928 | p496 929 | (dp497 930 | S'extended_fuses' 931 | p498 932 | S'0x05' 933 | p499 934 | sS'high_fuses' 935 | p500 936 | S'0xDA' 937 | p501 938 | sS'low_fuses' 939 | p502 940 | S'0xFF' 941 | p503 942 | sS'lock_bits' 943 | p504 944 | S'0x0F' 945 | p505 946 | sS'file' 947 | p506 948 | S'ATmegaBOOT_168_atmega328_pro_8MHz.hex' 949 | p507 950 | sS'path' 951 | p508 952 | S'arduino:atmega' 953 | p509 954 | sS'unlock_bits' 955 | p510 956 | S'0x3F' 957 | p511 958 | ssS'upload' 959 | p512 960 | (dp513 961 | S'protocol' 962 | p514 963 | S'arduino' 964 | p515 965 | sS'maximum_size' 966 | p516 967 | S'30720' 968 | p517 969 | sS'speed' 970 | p518 971 | S'57600' 972 | p519 973 | ssS'build' 974 | p520 975 | (dp521 976 | S'core' 977 | p522 978 | S'arduino' 979 | p523 980 | sS'mcu' 981 | p524 982 | S'atmega328p' 983 | p525 984 | sS'f_cpu' 985 | p526 986 | S'8000000L' 987 | p527 988 | sS'variant' 989 | p528 990 | S'eightanaloginputs' 991 | p529 992 | ssS'name' 993 | p530 994 | S'Arduino Fio' 995 | p531 996 | saa(lp532 997 | S'bt328' 998 | p533 999 | a(dp534 1000 | S'bootloader' 1001 | p535 1002 | (dp536 1003 | S'extended_fuses' 1004 | p537 1005 | S'0x05' 1006 | p538 1007 | sS'high_fuses' 1008 | p539 1009 | S'0xd8' 1010 | p540 1011 | sS'low_fuses' 1012 | p541 1013 | S'0xff' 1014 | p542 1015 | sS'lock_bits' 1016 | p543 1017 | S'0x0F' 1018 | p544 1019 | sS'file' 1020 | p545 1021 | S'ATmegaBOOT_168_atmega328_bt.hex' 1022 | p546 1023 | sS'path' 1024 | p547 1025 | S'bt' 1026 | p548 1027 | sS'unlock_bits' 1028 | p549 1029 | S'0x3F' 1030 | p550 1031 | ssS'upload' 1032 | p551 1033 | (dp552 1034 | S'protocol' 1035 | p553 1036 | S'arduino' 1037 | p554 1038 | sS'maximum_size' 1039 | p555 1040 | S'28672' 1041 | p556 1042 | sS'speed' 1043 | p557 1044 | S'19200' 1045 | p558 1046 | sS'disable_flushing' 1047 | p559 1048 | S'true' 1049 | p560 1050 | ssS'build' 1051 | p561 1052 | (dp562 1053 | S'core' 1054 | p563 1055 | S'arduino' 1056 | p564 1057 | sS'mcu' 1058 | p565 1059 | S'atmega328p' 1060 | p566 1061 | sS'f_cpu' 1062 | p567 1063 | S'16000000L' 1064 | p568 1065 | sS'variant' 1066 | p569 1067 | S'eightanaloginputs' 1068 | p570 1069 | ssS'name' 1070 | p571 1071 | S'Arduino BT w/ ATmega328' 1072 | p572 1073 | saa(lp573 1074 | S'bt' 1075 | p574 1076 | a(dp575 1077 | S'bootloader' 1078 | p576 1079 | (dp577 1080 | S'extended_fuses' 1081 | p578 1082 | S'0x00' 1083 | p579 1084 | sS'high_fuses' 1085 | p580 1086 | S'0xdd' 1087 | p581 1088 | sS'low_fuses' 1089 | p582 1090 | S'0xff' 1091 | p583 1092 | sS'lock_bits' 1093 | p584 1094 | S'0x0F' 1095 | p585 1096 | sS'file' 1097 | p586 1098 | S'ATmegaBOOT_168.hex' 1099 | p587 1100 | sS'path' 1101 | p588 1102 | S'bt' 1103 | p589 1104 | sS'unlock_bits' 1105 | p590 1106 | S'0x3F' 1107 | p591 1108 | ssS'upload' 1109 | p592 1110 | (dp593 1111 | S'protocol' 1112 | p594 1113 | S'arduino' 1114 | p595 1115 | sS'maximum_size' 1116 | p596 1117 | S'14336' 1118 | p597 1119 | sS'speed' 1120 | p598 1121 | S'19200' 1122 | p599 1123 | sS'disable_flushing' 1124 | p600 1125 | S'true' 1126 | p601 1127 | ssS'build' 1128 | p602 1129 | (dp603 1130 | S'core' 1131 | p604 1132 | S'arduino' 1133 | p605 1134 | sS'mcu' 1135 | p606 1136 | S'atmega168' 1137 | p607 1138 | sS'f_cpu' 1139 | p608 1140 | S'16000000L' 1141 | p609 1142 | sS'variant' 1143 | p610 1144 | S'eightanaloginputs' 1145 | p611 1146 | ssS'name' 1147 | p612 1148 | S'Arduino BT w/ ATmega168' 1149 | p613 1150 | saa(lp614 1151 | S'lilypad328' 1152 | p615 1153 | a(dp616 1154 | S'bootloader' 1155 | p617 1156 | (dp618 1157 | S'extended_fuses' 1158 | p619 1159 | S'0x05' 1160 | p620 1161 | sS'high_fuses' 1162 | p621 1163 | S'0xDA' 1164 | p622 1165 | sS'low_fuses' 1166 | p623 1167 | S'0xFF' 1168 | p624 1169 | sS'lock_bits' 1170 | p625 1171 | S'0x0F' 1172 | p626 1173 | sS'file' 1174 | p627 1175 | S'ATmegaBOOT_168_atmega328_pro_8MHz.hex' 1176 | p628 1177 | sS'path' 1178 | p629 1179 | S'atmega' 1180 | p630 1181 | sS'unlock_bits' 1182 | p631 1183 | S'0x3F' 1184 | p632 1185 | ssS'upload' 1186 | p633 1187 | (dp634 1188 | S'protocol' 1189 | p635 1190 | S'arduino' 1191 | p636 1192 | sS'maximum_size' 1193 | p637 1194 | S'30720' 1195 | p638 1196 | sS'speed' 1197 | p639 1198 | S'57600' 1199 | p640 1200 | ssS'build' 1201 | p641 1202 | (dp642 1203 | S'core' 1204 | p643 1205 | S'arduino' 1206 | p644 1207 | sS'mcu' 1208 | p645 1209 | S'atmega328p' 1210 | p646 1211 | sS'f_cpu' 1212 | p647 1213 | S'8000000L' 1214 | p648 1215 | sS'variant' 1216 | p649 1217 | S'standard' 1218 | p650 1219 | ssS'name' 1220 | p651 1221 | S'LilyPad Arduino w/ ATmega328' 1222 | p652 1223 | saa(lp653 1224 | S'lilypad' 1225 | p654 1226 | a(dp655 1227 | S'bootloader' 1228 | p656 1229 | (dp657 1230 | S'extended_fuses' 1231 | p658 1232 | S'0x00' 1233 | p659 1234 | sS'high_fuses' 1235 | p660 1236 | S'0xdd' 1237 | p661 1238 | sS'low_fuses' 1239 | p662 1240 | S'0xe2' 1241 | p663 1242 | sS'lock_bits' 1243 | p664 1244 | S'0x0F' 1245 | p665 1246 | sS'file' 1247 | p666 1248 | S'LilyPadBOOT_168.hex' 1249 | p667 1250 | sS'path' 1251 | p668 1252 | S'lilypad' 1253 | p669 1254 | sS'unlock_bits' 1255 | p670 1256 | S'0x3F' 1257 | p671 1258 | ssS'upload' 1259 | p672 1260 | (dp673 1261 | S'protocol' 1262 | p674 1263 | S'arduino' 1264 | p675 1265 | sS'maximum_size' 1266 | p676 1267 | S'14336' 1268 | p677 1269 | sS'speed' 1270 | p678 1271 | S'19200' 1272 | p679 1273 | ssS'build' 1274 | p680 1275 | (dp681 1276 | S'core' 1277 | p682 1278 | S'arduino' 1279 | p683 1280 | sS'mcu' 1281 | p684 1282 | S'atmega168' 1283 | p685 1284 | sS'f_cpu' 1285 | p686 1286 | S'8000000L' 1287 | p687 1288 | sS'variant' 1289 | p688 1290 | S'standard' 1291 | p689 1292 | ssS'name' 1293 | p690 1294 | S'LilyPad Arduino w/ ATmega168' 1295 | p691 1296 | saa(lp692 1297 | S'pro5v328' 1298 | p693 1299 | a(dp694 1300 | S'bootloader' 1301 | p695 1302 | (dp696 1303 | S'extended_fuses' 1304 | p697 1305 | S'0x05' 1306 | p698 1307 | sS'high_fuses' 1308 | p699 1309 | S'0xDA' 1310 | p700 1311 | sS'low_fuses' 1312 | p701 1313 | S'0xFF' 1314 | p702 1315 | sS'lock_bits' 1316 | p703 1317 | S'0x0F' 1318 | p704 1319 | sS'file' 1320 | p705 1321 | S'ATmegaBOOT_168_atmega328.hex' 1322 | p706 1323 | sS'path' 1324 | p707 1325 | S'atmega' 1326 | p708 1327 | sS'unlock_bits' 1328 | p709 1329 | S'0x3F' 1330 | p710 1331 | ssS'upload' 1332 | p711 1333 | (dp712 1334 | S'protocol' 1335 | p713 1336 | S'arduino' 1337 | p714 1338 | sS'maximum_size' 1339 | p715 1340 | S'30720' 1341 | p716 1342 | sS'speed' 1343 | p717 1344 | S'57600' 1345 | p718 1346 | ssS'build' 1347 | p719 1348 | (dp720 1349 | S'core' 1350 | p721 1351 | S'arduino' 1352 | p722 1353 | sS'mcu' 1354 | p723 1355 | S'atmega328p' 1356 | p724 1357 | sS'f_cpu' 1358 | p725 1359 | S'16000000L' 1360 | p726 1361 | sS'variant' 1362 | p727 1363 | S'standard' 1364 | p728 1365 | ssS'name' 1366 | p729 1367 | S'Arduino Pro or Pro Mini (5V, 16 MHz) w/ ATmega328' 1368 | p730 1369 | saa(lp731 1370 | S'pro5v' 1371 | p732 1372 | a(dp733 1373 | S'bootloader' 1374 | p734 1375 | (dp735 1376 | S'extended_fuses' 1377 | p736 1378 | S'0x00' 1379 | p737 1380 | sS'high_fuses' 1381 | p738 1382 | S'0xdd' 1383 | p739 1384 | sS'low_fuses' 1385 | p740 1386 | S'0xff' 1387 | p741 1388 | sS'lock_bits' 1389 | p742 1390 | S'0x0F' 1391 | p743 1392 | sS'file' 1393 | p744 1394 | S'ATmegaBOOT_168_diecimila.hex' 1395 | p745 1396 | sS'path' 1397 | p746 1398 | S'atmega' 1399 | p747 1400 | sS'unlock_bits' 1401 | p748 1402 | S'0x3F' 1403 | p749 1404 | ssS'upload' 1405 | p750 1406 | (dp751 1407 | S'protocol' 1408 | p752 1409 | S'arduino' 1410 | p753 1411 | sS'maximum_size' 1412 | p754 1413 | S'14336' 1414 | p755 1415 | sS'speed' 1416 | p756 1417 | S'19200' 1418 | p757 1419 | ssS'build' 1420 | p758 1421 | (dp759 1422 | S'core' 1423 | p760 1424 | S'arduino' 1425 | p761 1426 | sS'mcu' 1427 | p762 1428 | S'atmega168' 1429 | p763 1430 | sS'f_cpu' 1431 | p764 1432 | S'16000000L' 1433 | p765 1434 | sS'variant' 1435 | p766 1436 | S'standard' 1437 | p767 1438 | ssS'name' 1439 | p768 1440 | S'Arduino Pro or Pro Mini (5V, 16 MHz) w/ ATmega168' 1441 | p769 1442 | saa(lp770 1443 | S'pro328' 1444 | p771 1445 | a(dp772 1446 | S'bootloader' 1447 | p773 1448 | (dp774 1449 | S'extended_fuses' 1450 | p775 1451 | S'0x05' 1452 | p776 1453 | sS'high_fuses' 1454 | p777 1455 | S'0xDA' 1456 | p778 1457 | sS'low_fuses' 1458 | p779 1459 | S'0xFF' 1460 | p780 1461 | sS'lock_bits' 1462 | p781 1463 | S'0x0F' 1464 | p782 1465 | sS'file' 1466 | p783 1467 | S'ATmegaBOOT_168_atmega328_pro_8MHz.hex' 1468 | p784 1469 | sS'path' 1470 | p785 1471 | S'atmega' 1472 | p786 1473 | sS'unlock_bits' 1474 | p787 1475 | S'0x3F' 1476 | p788 1477 | ssS'upload' 1478 | p789 1479 | (dp790 1480 | S'protocol' 1481 | p791 1482 | S'arduino' 1483 | p792 1484 | sS'maximum_size' 1485 | p793 1486 | S'30720' 1487 | p794 1488 | sS'speed' 1489 | p795 1490 | S'57600' 1491 | p796 1492 | ssS'build' 1493 | p797 1494 | (dp798 1495 | S'core' 1496 | p799 1497 | S'arduino' 1498 | p800 1499 | sS'mcu' 1500 | p801 1501 | S'atmega328p' 1502 | p802 1503 | sS'f_cpu' 1504 | p803 1505 | S'8000000L' 1506 | p804 1507 | sS'variant' 1508 | p805 1509 | S'standard' 1510 | p806 1511 | ssS'name' 1512 | p807 1513 | S'Arduino Pro or Pro Mini (3.3V, 8 MHz) w/ ATmega328' 1514 | p808 1515 | saa(lp809 1516 | S'pro' 1517 | p810 1518 | a(dp811 1519 | S'bootloader' 1520 | p812 1521 | (dp813 1522 | S'extended_fuses' 1523 | p814 1524 | S'0x00' 1525 | p815 1526 | sS'high_fuses' 1527 | p816 1528 | S'0xdd' 1529 | p817 1530 | sS'low_fuses' 1531 | p818 1532 | S'0xc6' 1533 | p819 1534 | sS'lock_bits' 1535 | p820 1536 | S'0x0F' 1537 | p821 1538 | sS'file' 1539 | p822 1540 | S'ATmegaBOOT_168_pro_8MHz.hex' 1541 | p823 1542 | sS'path' 1543 | p824 1544 | S'atmega' 1545 | p825 1546 | sS'unlock_bits' 1547 | p826 1548 | S'0x3F' 1549 | p827 1550 | ssS'upload' 1551 | p828 1552 | (dp829 1553 | S'protocol' 1554 | p830 1555 | S'arduino' 1556 | p831 1557 | sS'maximum_size' 1558 | p832 1559 | S'14336' 1560 | p833 1561 | sS'speed' 1562 | p834 1563 | S'19200' 1564 | p835 1565 | ssS'build' 1566 | p836 1567 | (dp837 1568 | S'core' 1569 | p838 1570 | S'arduino' 1571 | p839 1572 | sS'mcu' 1573 | p840 1574 | S'atmega168' 1575 | p841 1576 | sS'f_cpu' 1577 | p842 1578 | S'8000000L' 1579 | p843 1580 | sS'variant' 1581 | p844 1582 | S'standard' 1583 | p845 1584 | ssS'name' 1585 | p846 1586 | S'Arduino Pro or Pro Mini (3.3V, 8 MHz) w/ ATmega168' 1587 | p847 1588 | saa(lp848 1589 | S'atmega168' 1590 | p849 1591 | a(dp850 1592 | S'bootloader' 1593 | p851 1594 | (dp852 1595 | S'extended_fuses' 1596 | p853 1597 | S'0x00' 1598 | p854 1599 | sS'high_fuses' 1600 | p855 1601 | S'0xdd' 1602 | p856 1603 | sS'low_fuses' 1604 | p857 1605 | S'0xff' 1606 | p858 1607 | sS'lock_bits' 1608 | p859 1609 | S'0x0F' 1610 | p860 1611 | sS'file' 1612 | p861 1613 | S'ATmegaBOOT_168_ng.hex' 1614 | p862 1615 | sS'path' 1616 | p863 1617 | S'atmega' 1618 | p864 1619 | sS'unlock_bits' 1620 | p865 1621 | S'0x3F' 1622 | p866 1623 | ssS'upload' 1624 | p867 1625 | (dp868 1626 | S'protocol' 1627 | p869 1628 | S'arduino' 1629 | p870 1630 | sS'maximum_size' 1631 | p871 1632 | S'14336' 1633 | p872 1634 | sS'speed' 1635 | p873 1636 | S'19200' 1637 | p874 1638 | ssS'build' 1639 | p875 1640 | (dp876 1641 | S'core' 1642 | p877 1643 | S'arduino' 1644 | p878 1645 | sS'mcu' 1646 | p879 1647 | S'atmega168' 1648 | p880 1649 | sS'f_cpu' 1650 | p881 1651 | S'16000000L' 1652 | p882 1653 | sS'variant' 1654 | p883 1655 | S'standard' 1656 | p884 1657 | ssS'name' 1658 | p885 1659 | S'Arduino NG or older w/ ATmega168' 1660 | p886 1661 | saa(lp887 1662 | S'atmega8' 1663 | p888 1664 | a(dp889 1665 | S'bootloader' 1666 | p890 1667 | (dp891 1668 | S'high_fuses' 1669 | p892 1670 | S'0xca' 1671 | p893 1672 | sS'low_fuses' 1673 | p894 1674 | S'0xdf' 1675 | p895 1676 | sS'lock_bits' 1677 | p896 1678 | S'0x0F' 1679 | p897 1680 | sS'file' 1681 | p898 1682 | S'ATmegaBOOT.hex' 1683 | p899 1684 | sS'path' 1685 | p900 1686 | S'atmega8' 1687 | p901 1688 | sS'unlock_bits' 1689 | p902 1690 | S'0x3F' 1691 | p903 1692 | ssS'upload' 1693 | p904 1694 | (dp905 1695 | S'protocol' 1696 | p906 1697 | S'arduino' 1698 | p907 1699 | sS'maximum_size' 1700 | p908 1701 | S'7168' 1702 | p909 1703 | sS'speed' 1704 | p910 1705 | S'19200' 1706 | p911 1707 | ssS'build' 1708 | p912 1709 | (dp913 1710 | S'core' 1711 | p914 1712 | S'arduino' 1713 | p915 1714 | sS'mcu' 1715 | p916 1716 | S'atmega8' 1717 | p917 1718 | sS'f_cpu' 1719 | p918 1720 | S'16000000L' 1721 | p919 1722 | sS'variant' 1723 | p920 1724 | S'standard' 1725 | p921 1726 | ssS'name' 1727 | p922 1728 | S'Arduino NG or older w/ ATmega8' 1729 | p923 1730 | saatp924 1731 | Rp925 1732 | (dp926 1733 | S'default' 1734 | p927 1735 | S'uno' 1736 | p928 1737 | sbtp929 1738 | a(S'cxx' 1739 | p930 1740 | S'/usr/bin/avr-g++' 1741 | p931 1742 | tp932 1743 | a. -------------------------------------------------------------------------------- /example/.build/uno/Makefile: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | .build/uno/PinChangeInt/Examples/ByteBuffer/ByteBuffer.o : lib/PinChangeInt/Examples/ByteBuffer/ByteBuffer.cpp 26 | @echo PinChangeInt/Examples/ByteBuffer/ByteBuffer.cpp 27 | @mkdir -p .build/uno/PinChangeInt/Examples/ByteBuffer 28 | @/usr/bin/avr-g++ -mmcu=atmega328p -ffunction-sections -fdata-sections -g -Os -w -DF_CPU=16000000L -DARDUINO=100 -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard -Ilib/PinChangeInt -Ilib/PinChangeInt/Examples -Ilib/PinChangeInt/Examples/ByteBuffer -Ilib/PinChangeInt/Examples/GetPSTR -Ilib/PinChangeInt/Examples/PinChangeIntSpeedTest -Ilib/PinChangeInt/Examples/PinChangeIntTest2 -Ilib/PinChangeInt/Examples/PinChangeIntTest -Ilib/PinChangeInt/Examples/PinChangeIntExample -Ilib/RCArduinoFastLib -I/usr/share/arduino/hardware/arduino/cores/arduino -fno-exceptions -o $@ -c lib/PinChangeInt/Examples/ByteBuffer/ByteBuffer.cpp 29 | include .build/uno/PinChangeInt/Examples/ByteBuffer/ByteBuffer.d 30 | 31 | 32 | 33 | .build/uno/PinChangeInt/libPinChangeInt.a : .build/uno/PinChangeInt/Examples/ByteBuffer/ByteBuffer.o 34 | @echo Linking libPinChangeInt.a 35 | @/usr/bin/avr-ar rcs $@ $^ 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | .build/uno/RCArduinoFastLib/RCArduinoFastLib.o : lib/RCArduinoFastLib/RCArduinoFastLib.cpp 49 | @echo RCArduinoFastLib/RCArduinoFastLib.cpp 50 | @mkdir -p .build/uno/RCArduinoFastLib 51 | @/usr/bin/avr-g++ -mmcu=atmega328p -ffunction-sections -fdata-sections -g -Os -w -DF_CPU=16000000L -DARDUINO=100 -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard -Ilib/PinChangeInt -Ilib/PinChangeInt/Examples -Ilib/PinChangeInt/Examples/ByteBuffer -Ilib/PinChangeInt/Examples/GetPSTR -Ilib/PinChangeInt/Examples/PinChangeIntSpeedTest -Ilib/PinChangeInt/Examples/PinChangeIntTest2 -Ilib/PinChangeInt/Examples/PinChangeIntTest -Ilib/PinChangeInt/Examples/PinChangeIntExample -Ilib/RCArduinoFastLib -I/usr/share/arduino/hardware/arduino/cores/arduino -fno-exceptions -o $@ -c lib/RCArduinoFastLib/RCArduinoFastLib.cpp 52 | include .build/uno/RCArduinoFastLib/RCArduinoFastLib.d 53 | 54 | 55 | 56 | .build/uno/RCArduinoFastLib/libRCArduinoFastLib.a : .build/uno/RCArduinoFastLib/RCArduinoFastLib.o 57 | @echo Linking libRCArduinoFastLib.a 58 | @/usr/bin/avr-ar rcs $@ $^ 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | .build/uno/arduino/wiring_shift.o : /usr/share/arduino/hardware/arduino/cores/arduino/wiring_shift.c 67 | @echo arduino/wiring_shift.c 68 | @mkdir -p .build/uno/arduino 69 | @/usr/bin/avr-gcc -mmcu=atmega328p -ffunction-sections -fdata-sections -g -Os -w -DF_CPU=16000000L -DARDUINO=100 -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard -Ilib/PinChangeInt -Ilib/PinChangeInt/Examples -Ilib/PinChangeInt/Examples/ByteBuffer -Ilib/PinChangeInt/Examples/GetPSTR -Ilib/PinChangeInt/Examples/PinChangeIntSpeedTest -Ilib/PinChangeInt/Examples/PinChangeIntTest2 -Ilib/PinChangeInt/Examples/PinChangeIntTest -Ilib/PinChangeInt/Examples/PinChangeIntExample -Ilib/RCArduinoFastLib -I/usr/share/arduino/hardware/arduino/cores/arduino -o $@ -c /usr/share/arduino/hardware/arduino/cores/arduino/wiring_shift.c 70 | include .build/uno/arduino/wiring_shift.d 71 | 72 | .build/uno/arduino/wiring_analog.o : /usr/share/arduino/hardware/arduino/cores/arduino/wiring_analog.c 73 | @echo arduino/wiring_analog.c 74 | @mkdir -p .build/uno/arduino 75 | @/usr/bin/avr-gcc -mmcu=atmega328p -ffunction-sections -fdata-sections -g -Os -w -DF_CPU=16000000L -DARDUINO=100 -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard -Ilib/PinChangeInt -Ilib/PinChangeInt/Examples -Ilib/PinChangeInt/Examples/ByteBuffer -Ilib/PinChangeInt/Examples/GetPSTR -Ilib/PinChangeInt/Examples/PinChangeIntSpeedTest -Ilib/PinChangeInt/Examples/PinChangeIntTest2 -Ilib/PinChangeInt/Examples/PinChangeIntTest -Ilib/PinChangeInt/Examples/PinChangeIntExample -Ilib/RCArduinoFastLib -I/usr/share/arduino/hardware/arduino/cores/arduino -o $@ -c /usr/share/arduino/hardware/arduino/cores/arduino/wiring_analog.c 76 | include .build/uno/arduino/wiring_analog.d 77 | 78 | .build/uno/arduino/wiring.o : /usr/share/arduino/hardware/arduino/cores/arduino/wiring.c 79 | @echo arduino/wiring.c 80 | @mkdir -p .build/uno/arduino 81 | @/usr/bin/avr-gcc -mmcu=atmega328p -ffunction-sections -fdata-sections -g -Os -w -DF_CPU=16000000L -DARDUINO=100 -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard -Ilib/PinChangeInt -Ilib/PinChangeInt/Examples -Ilib/PinChangeInt/Examples/ByteBuffer -Ilib/PinChangeInt/Examples/GetPSTR -Ilib/PinChangeInt/Examples/PinChangeIntSpeedTest -Ilib/PinChangeInt/Examples/PinChangeIntTest2 -Ilib/PinChangeInt/Examples/PinChangeIntTest -Ilib/PinChangeInt/Examples/PinChangeIntExample -Ilib/RCArduinoFastLib -I/usr/share/arduino/hardware/arduino/cores/arduino -o $@ -c /usr/share/arduino/hardware/arduino/cores/arduino/wiring.c 82 | include .build/uno/arduino/wiring.d 83 | 84 | .build/uno/arduino/wiring_digital.o : /usr/share/arduino/hardware/arduino/cores/arduino/wiring_digital.c 85 | @echo arduino/wiring_digital.c 86 | @mkdir -p .build/uno/arduino 87 | @/usr/bin/avr-gcc -mmcu=atmega328p -ffunction-sections -fdata-sections -g -Os -w -DF_CPU=16000000L -DARDUINO=100 -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard -Ilib/PinChangeInt -Ilib/PinChangeInt/Examples -Ilib/PinChangeInt/Examples/ByteBuffer -Ilib/PinChangeInt/Examples/GetPSTR -Ilib/PinChangeInt/Examples/PinChangeIntSpeedTest -Ilib/PinChangeInt/Examples/PinChangeIntTest2 -Ilib/PinChangeInt/Examples/PinChangeIntTest -Ilib/PinChangeInt/Examples/PinChangeIntExample -Ilib/RCArduinoFastLib -I/usr/share/arduino/hardware/arduino/cores/arduino -o $@ -c /usr/share/arduino/hardware/arduino/cores/arduino/wiring_digital.c 88 | include .build/uno/arduino/wiring_digital.d 89 | 90 | .build/uno/arduino/wiring_pulse.o : /usr/share/arduino/hardware/arduino/cores/arduino/wiring_pulse.c 91 | @echo arduino/wiring_pulse.c 92 | @mkdir -p .build/uno/arduino 93 | @/usr/bin/avr-gcc -mmcu=atmega328p -ffunction-sections -fdata-sections -g -Os -w -DF_CPU=16000000L -DARDUINO=100 -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard -Ilib/PinChangeInt -Ilib/PinChangeInt/Examples -Ilib/PinChangeInt/Examples/ByteBuffer -Ilib/PinChangeInt/Examples/GetPSTR -Ilib/PinChangeInt/Examples/PinChangeIntSpeedTest -Ilib/PinChangeInt/Examples/PinChangeIntTest2 -Ilib/PinChangeInt/Examples/PinChangeIntTest -Ilib/PinChangeInt/Examples/PinChangeIntExample -Ilib/RCArduinoFastLib -I/usr/share/arduino/hardware/arduino/cores/arduino -o $@ -c /usr/share/arduino/hardware/arduino/cores/arduino/wiring_pulse.c 94 | include .build/uno/arduino/wiring_pulse.d 95 | 96 | .build/uno/arduino/WInterrupts.o : /usr/share/arduino/hardware/arduino/cores/arduino/WInterrupts.c 97 | @echo arduino/WInterrupts.c 98 | @mkdir -p .build/uno/arduino 99 | @/usr/bin/avr-gcc -mmcu=atmega328p -ffunction-sections -fdata-sections -g -Os -w -DF_CPU=16000000L -DARDUINO=100 -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard -Ilib/PinChangeInt -Ilib/PinChangeInt/Examples -Ilib/PinChangeInt/Examples/ByteBuffer -Ilib/PinChangeInt/Examples/GetPSTR -Ilib/PinChangeInt/Examples/PinChangeIntSpeedTest -Ilib/PinChangeInt/Examples/PinChangeIntTest2 -Ilib/PinChangeInt/Examples/PinChangeIntTest -Ilib/PinChangeInt/Examples/PinChangeIntExample -Ilib/RCArduinoFastLib -I/usr/share/arduino/hardware/arduino/cores/arduino -o $@ -c /usr/share/arduino/hardware/arduino/cores/arduino/WInterrupts.c 100 | include .build/uno/arduino/WInterrupts.d 101 | 102 | 103 | 104 | 105 | 106 | 107 | .build/uno/arduino/WMath.o : /usr/share/arduino/hardware/arduino/cores/arduino/WMath.cpp 108 | @echo arduino/WMath.cpp 109 | @mkdir -p .build/uno/arduino 110 | @/usr/bin/avr-g++ -mmcu=atmega328p -ffunction-sections -fdata-sections -g -Os -w -DF_CPU=16000000L -DARDUINO=100 -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard -Ilib/PinChangeInt -Ilib/PinChangeInt/Examples -Ilib/PinChangeInt/Examples/ByteBuffer -Ilib/PinChangeInt/Examples/GetPSTR -Ilib/PinChangeInt/Examples/PinChangeIntSpeedTest -Ilib/PinChangeInt/Examples/PinChangeIntTest2 -Ilib/PinChangeInt/Examples/PinChangeIntTest -Ilib/PinChangeInt/Examples/PinChangeIntExample -Ilib/RCArduinoFastLib -I/usr/share/arduino/hardware/arduino/cores/arduino -fno-exceptions -o $@ -c /usr/share/arduino/hardware/arduino/cores/arduino/WMath.cpp 111 | include .build/uno/arduino/WMath.d 112 | 113 | .build/uno/arduino/WString.o : /usr/share/arduino/hardware/arduino/cores/arduino/WString.cpp 114 | @echo arduino/WString.cpp 115 | @mkdir -p .build/uno/arduino 116 | @/usr/bin/avr-g++ -mmcu=atmega328p -ffunction-sections -fdata-sections -g -Os -w -DF_CPU=16000000L -DARDUINO=100 -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard -Ilib/PinChangeInt -Ilib/PinChangeInt/Examples -Ilib/PinChangeInt/Examples/ByteBuffer -Ilib/PinChangeInt/Examples/GetPSTR -Ilib/PinChangeInt/Examples/PinChangeIntSpeedTest -Ilib/PinChangeInt/Examples/PinChangeIntTest2 -Ilib/PinChangeInt/Examples/PinChangeIntTest -Ilib/PinChangeInt/Examples/PinChangeIntExample -Ilib/RCArduinoFastLib -I/usr/share/arduino/hardware/arduino/cores/arduino -fno-exceptions -o $@ -c /usr/share/arduino/hardware/arduino/cores/arduino/WString.cpp 117 | include .build/uno/arduino/WString.d 118 | 119 | .build/uno/arduino/CDC.o : /usr/share/arduino/hardware/arduino/cores/arduino/CDC.cpp 120 | @echo arduino/CDC.cpp 121 | @mkdir -p .build/uno/arduino 122 | @/usr/bin/avr-g++ -mmcu=atmega328p -ffunction-sections -fdata-sections -g -Os -w -DF_CPU=16000000L -DARDUINO=100 -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard -Ilib/PinChangeInt -Ilib/PinChangeInt/Examples -Ilib/PinChangeInt/Examples/ByteBuffer -Ilib/PinChangeInt/Examples/GetPSTR -Ilib/PinChangeInt/Examples/PinChangeIntSpeedTest -Ilib/PinChangeInt/Examples/PinChangeIntTest2 -Ilib/PinChangeInt/Examples/PinChangeIntTest -Ilib/PinChangeInt/Examples/PinChangeIntExample -Ilib/RCArduinoFastLib -I/usr/share/arduino/hardware/arduino/cores/arduino -fno-exceptions -o $@ -c /usr/share/arduino/hardware/arduino/cores/arduino/CDC.cpp 123 | include .build/uno/arduino/CDC.d 124 | 125 | .build/uno/arduino/Tone.o : /usr/share/arduino/hardware/arduino/cores/arduino/Tone.cpp 126 | @echo arduino/Tone.cpp 127 | @mkdir -p .build/uno/arduino 128 | @/usr/bin/avr-g++ -mmcu=atmega328p -ffunction-sections -fdata-sections -g -Os -w -DF_CPU=16000000L -DARDUINO=100 -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard -Ilib/PinChangeInt -Ilib/PinChangeInt/Examples -Ilib/PinChangeInt/Examples/ByteBuffer -Ilib/PinChangeInt/Examples/GetPSTR -Ilib/PinChangeInt/Examples/PinChangeIntSpeedTest -Ilib/PinChangeInt/Examples/PinChangeIntTest2 -Ilib/PinChangeInt/Examples/PinChangeIntTest -Ilib/PinChangeInt/Examples/PinChangeIntExample -Ilib/RCArduinoFastLib -I/usr/share/arduino/hardware/arduino/cores/arduino -fno-exceptions -o $@ -c /usr/share/arduino/hardware/arduino/cores/arduino/Tone.cpp 129 | include .build/uno/arduino/Tone.d 130 | 131 | .build/uno/arduino/HardwareSerial.o : /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.cpp 132 | @echo arduino/HardwareSerial.cpp 133 | @mkdir -p .build/uno/arduino 134 | @/usr/bin/avr-g++ -mmcu=atmega328p -ffunction-sections -fdata-sections -g -Os -w -DF_CPU=16000000L -DARDUINO=100 -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard -Ilib/PinChangeInt -Ilib/PinChangeInt/Examples -Ilib/PinChangeInt/Examples/ByteBuffer -Ilib/PinChangeInt/Examples/GetPSTR -Ilib/PinChangeInt/Examples/PinChangeIntSpeedTest -Ilib/PinChangeInt/Examples/PinChangeIntTest2 -Ilib/PinChangeInt/Examples/PinChangeIntTest -Ilib/PinChangeInt/Examples/PinChangeIntExample -Ilib/RCArduinoFastLib -I/usr/share/arduino/hardware/arduino/cores/arduino -fno-exceptions -o $@ -c /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.cpp 135 | include .build/uno/arduino/HardwareSerial.d 136 | 137 | .build/uno/arduino/main.o : /usr/share/arduino/hardware/arduino/cores/arduino/main.cpp 138 | @echo arduino/main.cpp 139 | @mkdir -p .build/uno/arduino 140 | @/usr/bin/avr-g++ -mmcu=atmega328p -ffunction-sections -fdata-sections -g -Os -w -DF_CPU=16000000L -DARDUINO=100 -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard -Ilib/PinChangeInt -Ilib/PinChangeInt/Examples -Ilib/PinChangeInt/Examples/ByteBuffer -Ilib/PinChangeInt/Examples/GetPSTR -Ilib/PinChangeInt/Examples/PinChangeIntSpeedTest -Ilib/PinChangeInt/Examples/PinChangeIntTest2 -Ilib/PinChangeInt/Examples/PinChangeIntTest -Ilib/PinChangeInt/Examples/PinChangeIntExample -Ilib/RCArduinoFastLib -I/usr/share/arduino/hardware/arduino/cores/arduino -fno-exceptions -o $@ -c /usr/share/arduino/hardware/arduino/cores/arduino/main.cpp 141 | include .build/uno/arduino/main.d 142 | 143 | .build/uno/arduino/Stream.o : /usr/share/arduino/hardware/arduino/cores/arduino/Stream.cpp 144 | @echo arduino/Stream.cpp 145 | @mkdir -p .build/uno/arduino 146 | @/usr/bin/avr-g++ -mmcu=atmega328p -ffunction-sections -fdata-sections -g -Os -w -DF_CPU=16000000L -DARDUINO=100 -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard -Ilib/PinChangeInt -Ilib/PinChangeInt/Examples -Ilib/PinChangeInt/Examples/ByteBuffer -Ilib/PinChangeInt/Examples/GetPSTR -Ilib/PinChangeInt/Examples/PinChangeIntSpeedTest -Ilib/PinChangeInt/Examples/PinChangeIntTest2 -Ilib/PinChangeInt/Examples/PinChangeIntTest -Ilib/PinChangeInt/Examples/PinChangeIntExample -Ilib/RCArduinoFastLib -I/usr/share/arduino/hardware/arduino/cores/arduino -fno-exceptions -o $@ -c /usr/share/arduino/hardware/arduino/cores/arduino/Stream.cpp 147 | include .build/uno/arduino/Stream.d 148 | 149 | .build/uno/arduino/IPAddress.o : /usr/share/arduino/hardware/arduino/cores/arduino/IPAddress.cpp 150 | @echo arduino/IPAddress.cpp 151 | @mkdir -p .build/uno/arduino 152 | @/usr/bin/avr-g++ -mmcu=atmega328p -ffunction-sections -fdata-sections -g -Os -w -DF_CPU=16000000L -DARDUINO=100 -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard -Ilib/PinChangeInt -Ilib/PinChangeInt/Examples -Ilib/PinChangeInt/Examples/ByteBuffer -Ilib/PinChangeInt/Examples/GetPSTR -Ilib/PinChangeInt/Examples/PinChangeIntSpeedTest -Ilib/PinChangeInt/Examples/PinChangeIntTest2 -Ilib/PinChangeInt/Examples/PinChangeIntTest -Ilib/PinChangeInt/Examples/PinChangeIntExample -Ilib/RCArduinoFastLib -I/usr/share/arduino/hardware/arduino/cores/arduino -fno-exceptions -o $@ -c /usr/share/arduino/hardware/arduino/cores/arduino/IPAddress.cpp 153 | include .build/uno/arduino/IPAddress.d 154 | 155 | .build/uno/arduino/Print.o : /usr/share/arduino/hardware/arduino/cores/arduino/Print.cpp 156 | @echo arduino/Print.cpp 157 | @mkdir -p .build/uno/arduino 158 | @/usr/bin/avr-g++ -mmcu=atmega328p -ffunction-sections -fdata-sections -g -Os -w -DF_CPU=16000000L -DARDUINO=100 -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard -Ilib/PinChangeInt -Ilib/PinChangeInt/Examples -Ilib/PinChangeInt/Examples/ByteBuffer -Ilib/PinChangeInt/Examples/GetPSTR -Ilib/PinChangeInt/Examples/PinChangeIntSpeedTest -Ilib/PinChangeInt/Examples/PinChangeIntTest2 -Ilib/PinChangeInt/Examples/PinChangeIntTest -Ilib/PinChangeInt/Examples/PinChangeIntExample -Ilib/RCArduinoFastLib -I/usr/share/arduino/hardware/arduino/cores/arduino -fno-exceptions -o $@ -c /usr/share/arduino/hardware/arduino/cores/arduino/Print.cpp 159 | include .build/uno/arduino/Print.d 160 | 161 | .build/uno/arduino/HID.o : /usr/share/arduino/hardware/arduino/cores/arduino/HID.cpp 162 | @echo arduino/HID.cpp 163 | @mkdir -p .build/uno/arduino 164 | @/usr/bin/avr-g++ -mmcu=atmega328p -ffunction-sections -fdata-sections -g -Os -w -DF_CPU=16000000L -DARDUINO=100 -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard -Ilib/PinChangeInt -Ilib/PinChangeInt/Examples -Ilib/PinChangeInt/Examples/ByteBuffer -Ilib/PinChangeInt/Examples/GetPSTR -Ilib/PinChangeInt/Examples/PinChangeIntSpeedTest -Ilib/PinChangeInt/Examples/PinChangeIntTest2 -Ilib/PinChangeInt/Examples/PinChangeIntTest -Ilib/PinChangeInt/Examples/PinChangeIntExample -Ilib/RCArduinoFastLib -I/usr/share/arduino/hardware/arduino/cores/arduino -fno-exceptions -o $@ -c /usr/share/arduino/hardware/arduino/cores/arduino/HID.cpp 165 | include .build/uno/arduino/HID.d 166 | 167 | .build/uno/arduino/new.o : /usr/share/arduino/hardware/arduino/cores/arduino/new.cpp 168 | @echo arduino/new.cpp 169 | @mkdir -p .build/uno/arduino 170 | @/usr/bin/avr-g++ -mmcu=atmega328p -ffunction-sections -fdata-sections -g -Os -w -DF_CPU=16000000L -DARDUINO=100 -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard -Ilib/PinChangeInt -Ilib/PinChangeInt/Examples -Ilib/PinChangeInt/Examples/ByteBuffer -Ilib/PinChangeInt/Examples/GetPSTR -Ilib/PinChangeInt/Examples/PinChangeIntSpeedTest -Ilib/PinChangeInt/Examples/PinChangeIntTest2 -Ilib/PinChangeInt/Examples/PinChangeIntTest -Ilib/PinChangeInt/Examples/PinChangeIntExample -Ilib/RCArduinoFastLib -I/usr/share/arduino/hardware/arduino/cores/arduino -fno-exceptions -o $@ -c /usr/share/arduino/hardware/arduino/cores/arduino/new.cpp 171 | include .build/uno/arduino/new.d 172 | 173 | .build/uno/arduino/USBCore.o : /usr/share/arduino/hardware/arduino/cores/arduino/USBCore.cpp 174 | @echo arduino/USBCore.cpp 175 | @mkdir -p .build/uno/arduino 176 | @/usr/bin/avr-g++ -mmcu=atmega328p -ffunction-sections -fdata-sections -g -Os -w -DF_CPU=16000000L -DARDUINO=100 -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard -Ilib/PinChangeInt -Ilib/PinChangeInt/Examples -Ilib/PinChangeInt/Examples/ByteBuffer -Ilib/PinChangeInt/Examples/GetPSTR -Ilib/PinChangeInt/Examples/PinChangeIntSpeedTest -Ilib/PinChangeInt/Examples/PinChangeIntTest2 -Ilib/PinChangeInt/Examples/PinChangeIntTest -Ilib/PinChangeInt/Examples/PinChangeIntExample -Ilib/RCArduinoFastLib -I/usr/share/arduino/hardware/arduino/cores/arduino -fno-exceptions -o $@ -c /usr/share/arduino/hardware/arduino/cores/arduino/USBCore.cpp 177 | include .build/uno/arduino/USBCore.d 178 | 179 | 180 | 181 | .build/uno/arduino/libarduino.a : .build/uno/arduino/wiring_shift.o .build/uno/arduino/wiring_analog.o .build/uno/arduino/wiring.o .build/uno/arduino/wiring_digital.o .build/uno/arduino/wiring_pulse.o .build/uno/arduino/WInterrupts.o .build/uno/arduino/WMath.o .build/uno/arduino/WString.o .build/uno/arduino/CDC.o .build/uno/arduino/Tone.o .build/uno/arduino/HardwareSerial.o .build/uno/arduino/main.o .build/uno/arduino/Stream.o .build/uno/arduino/IPAddress.o .build/uno/arduino/Print.o .build/uno/arduino/HID.o .build/uno/arduino/new.o .build/uno/arduino/USBCore.o 182 | @echo Linking libarduino.a 183 | @/usr/bin/avr-ar rcs $@ $^ 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | .build/uno/src/sketch.o : .build/uno/src/sketch.cpp 200 | @echo src/sketch.cpp 201 | @mkdir -p .build/uno/src 202 | @/usr/bin/avr-g++ -mmcu=atmega328p -ffunction-sections -fdata-sections -g -Os -w -DF_CPU=16000000L -DARDUINO=100 -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard -Ilib/PinChangeInt -Ilib/PinChangeInt/Examples -Ilib/PinChangeInt/Examples/ByteBuffer -Ilib/PinChangeInt/Examples/GetPSTR -Ilib/PinChangeInt/Examples/PinChangeIntSpeedTest -Ilib/PinChangeInt/Examples/PinChangeIntTest2 -Ilib/PinChangeInt/Examples/PinChangeIntTest -Ilib/PinChangeInt/Examples/PinChangeIntExample -Ilib/RCArduinoFastLib -I/usr/share/arduino/hardware/arduino/cores/arduino -fno-exceptions -iquote src -o $@ -c .build/uno/src/sketch.cpp 203 | include .build/uno/src/sketch.d 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | .build/uno/firmware.elf : .build/uno/src/sketch.o .build/uno/PinChangeInt/libPinChangeInt.a .build/uno/RCArduinoFastLib/libRCArduinoFastLib.a .build/uno/arduino/libarduino.a 212 | @echo Linking firmware.elf 213 | @/usr/bin/avr-gcc -Os -Wl,--gc-sections -mmcu=atmega328p -o $@ $^ -lm 214 | 215 | 216 | .build/uno/firmware.hex : .build/uno/firmware.elf 217 | @echo Converting to firmware.hex 218 | @/usr/bin/avr-objcopy -O ihex -R .eeprom $^ $@ 219 | 220 | include .build/uno/src/dependencies.d .build/uno/arduino/dependencies.d .build/uno/PinChangeInt/dependencies.d .build/uno/RCArduinoFastLib/dependencies.d 221 | 222 | all : .build/uno/firmware.hex 223 | @true 224 | 225 | -------------------------------------------------------------------------------- /example/.build/uno/Makefile.deps: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | .build/uno/RCArduinoFastLib/RCArduinoFastLib.d : lib/RCArduinoFastLib/RCArduinoFastLib.cpp 14 | @mkdir -p .build/uno/RCArduinoFastLib 15 | @/usr/bin/avr-gcc -mmcu=atmega328p -ffunction-sections -fdata-sections -g -Os -w -DF_CPU=16000000L -DARDUINO=100 -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard -I/usr/share/arduino/hardware/arduino/cores/arduino -Ilib/RCArduinoFastLib -Ilib/PinChangeInt -Ilib/PinChangeInt/Examples -Ilib/PinChangeInt/Examples/ByteBuffer -Ilib/PinChangeInt/Examples/GetPSTR -Ilib/PinChangeInt/Examples/PinChangeIntSpeedTest -Ilib/PinChangeInt/Examples/PinChangeIntTest2 -Ilib/PinChangeInt/Examples/PinChangeIntTest -Ilib/PinChangeInt/Examples/PinChangeIntExample -I/usr/share/arduino/libraries/Wire -I/usr/share/arduino/libraries/Wire/utility -I/usr/share/arduino/libraries/SD -I/usr/share/arduino/libraries/SD/utility -I/usr/share/arduino/libraries/LiquidCrystal -I/usr/share/arduino/libraries/SoftwareSerial -I/usr/share/arduino/libraries/Servo -I/usr/share/arduino/libraries/Ethernet -I/usr/share/arduino/libraries/Ethernet/utility -I/usr/share/arduino/libraries/Firmata -I/usr/share/arduino/libraries/EEPROM -I/usr/share/arduino/libraries/SPI -I/usr/share/arduino/libraries/Stepper -MM $^ > $@ 16 | 17 | @printf ".build/uno/RCArduinoFastLib/RCArduinoFastLib.d .build/uno/RCArduinoFastLib/" | cat - $@ > $@~ && mv $@~ $@ 18 | 19 | 20 | 21 | .build/uno/RCArduinoFastLib/dependencies.d : .build/uno/RCArduinoFastLib/RCArduinoFastLib.d 22 | @echo Scanning dependencies of RCArduinoFastLib 23 | @mkdir -p .build/uno/RCArduinoFastLib 24 | @cat $^ > $@; 25 | 26 | all : .build/uno/RCArduinoFastLib/dependencies.d 27 | @true 28 | 29 | -------------------------------------------------------------------------------- /example/.build/uno/Makefile.sketch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | .build/uno/src/sketch.cpp : src/sketch.ino 7 | @mkdir -p .build/uno/src 8 | @echo src/sketch.ino 9 | @/usr/local/bin/ino preproc -o $@ $^ 10 | 11 | 12 | all : .build/uno/src/sketch.cpp 13 | @true 14 | 15 | -------------------------------------------------------------------------------- /example/.build/uno/PinChangeInt/Examples/ByteBuffer/ByteBuffer.d: -------------------------------------------------------------------------------- 1 | .build/uno/PinChangeInt/Examples/ByteBuffer/ByteBuffer.d .build/uno/PinChangeInt/Examples/ByteBuffer/ByteBuffer.o: lib/PinChangeInt/Examples/ByteBuffer/ByteBuffer.cpp \ 2 | lib/PinChangeInt/Examples/ByteBuffer/ByteBuffer.h \ 3 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 4 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 5 | /usr/share/arduino/hardware/arduino/cores/arduino/WCharacter.h \ 6 | /usr/share/arduino/hardware/arduino/cores/arduino/WString.h \ 7 | /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h \ 8 | /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h \ 9 | /usr/share/arduino/hardware/arduino/cores/arduino/Print.h \ 10 | /usr/share/arduino/hardware/arduino/cores/arduino/Printable.h \ 11 | /usr/share/arduino/hardware/arduino/cores/arduino/new.h \ 12 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h 13 | -------------------------------------------------------------------------------- /example/.build/uno/PinChangeInt/dependencies.d: -------------------------------------------------------------------------------- 1 | .build/uno/PinChangeInt/Examples/ByteBuffer/ByteBuffer.d .build/uno/PinChangeInt/Examples/ByteBuffer/ByteBuffer.o: lib/PinChangeInt/Examples/ByteBuffer/ByteBuffer.cpp \ 2 | lib/PinChangeInt/Examples/ByteBuffer/ByteBuffer.h \ 3 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 4 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 5 | /usr/share/arduino/hardware/arduino/cores/arduino/WCharacter.h \ 6 | /usr/share/arduino/hardware/arduino/cores/arduino/WString.h \ 7 | /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h \ 8 | /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h \ 9 | /usr/share/arduino/hardware/arduino/cores/arduino/Print.h \ 10 | /usr/share/arduino/hardware/arduino/cores/arduino/Printable.h \ 11 | /usr/share/arduino/hardware/arduino/cores/arduino/new.h \ 12 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h 13 | -------------------------------------------------------------------------------- /example/.build/uno/RCArduinoFastLib/RCArduinoFastLib.d: -------------------------------------------------------------------------------- 1 | .build/uno/RCArduinoFastLib/RCArduinoFastLib.d .build/uno/RCArduinoFastLib/RCArduinoFastLib.o: lib/RCArduinoFastLib/RCArduinoFastLib.cpp \ 2 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 3 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 4 | /usr/share/arduino/hardware/arduino/cores/arduino/WCharacter.h \ 5 | /usr/share/arduino/hardware/arduino/cores/arduino/WString.h \ 6 | /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h \ 7 | /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h \ 8 | /usr/share/arduino/hardware/arduino/cores/arduino/Print.h \ 9 | /usr/share/arduino/hardware/arduino/cores/arduino/Printable.h \ 10 | /usr/share/arduino/hardware/arduino/cores/arduino/new.h \ 11 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h \ 12 | lib/RCArduinoFastLib/RCArduinoFastLib.h 13 | -------------------------------------------------------------------------------- /example/.build/uno/RCArduinoFastLib/dependencies.d: -------------------------------------------------------------------------------- 1 | .build/uno/RCArduinoFastLib/RCArduinoFastLib.d .build/uno/RCArduinoFastLib/RCArduinoFastLib.o: lib/RCArduinoFastLib/RCArduinoFastLib.cpp \ 2 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 3 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 4 | /usr/share/arduino/hardware/arduino/cores/arduino/WCharacter.h \ 5 | /usr/share/arduino/hardware/arduino/cores/arduino/WString.h \ 6 | /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h \ 7 | /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h \ 8 | /usr/share/arduino/hardware/arduino/cores/arduino/Print.h \ 9 | /usr/share/arduino/hardware/arduino/cores/arduino/Printable.h \ 10 | /usr/share/arduino/hardware/arduino/cores/arduino/new.h \ 11 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h \ 12 | lib/RCArduinoFastLib/RCArduinoFastLib.h 13 | -------------------------------------------------------------------------------- /example/.build/uno/arduino/CDC.d: -------------------------------------------------------------------------------- 1 | .build/uno/arduino/CDC.d .build/uno/arduino/CDC.o: /usr/share/arduino/hardware/arduino/cores/arduino/CDC.cpp \ 2 | /usr/share/arduino/hardware/arduino/cores/arduino/Platform.h \ 3 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 4 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 5 | /usr/share/arduino/hardware/arduino/cores/arduino/WCharacter.h \ 6 | /usr/share/arduino/hardware/arduino/cores/arduino/WString.h \ 7 | /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h \ 8 | /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h \ 9 | /usr/share/arduino/hardware/arduino/cores/arduino/Print.h \ 10 | /usr/share/arduino/hardware/arduino/cores/arduino/Printable.h \ 11 | /usr/share/arduino/hardware/arduino/cores/arduino/new.h \ 12 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h \ 13 | /usr/share/arduino/hardware/arduino/cores/arduino/USBAPI.h 14 | -------------------------------------------------------------------------------- /example/.build/uno/arduino/HID.d: -------------------------------------------------------------------------------- 1 | .build/uno/arduino/HID.d .build/uno/arduino/HID.o: /usr/share/arduino/hardware/arduino/cores/arduino/HID.cpp \ 2 | /usr/share/arduino/hardware/arduino/cores/arduino/Platform.h \ 3 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 4 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 5 | /usr/share/arduino/hardware/arduino/cores/arduino/WCharacter.h \ 6 | /usr/share/arduino/hardware/arduino/cores/arduino/WString.h \ 7 | /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h \ 8 | /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h \ 9 | /usr/share/arduino/hardware/arduino/cores/arduino/Print.h \ 10 | /usr/share/arduino/hardware/arduino/cores/arduino/Printable.h \ 11 | /usr/share/arduino/hardware/arduino/cores/arduino/new.h \ 12 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h \ 13 | /usr/share/arduino/hardware/arduino/cores/arduino/USBAPI.h \ 14 | /usr/share/arduino/hardware/arduino/cores/arduino/USBDesc.h 15 | -------------------------------------------------------------------------------- /example/.build/uno/arduino/HardwareSerial.d: -------------------------------------------------------------------------------- 1 | .build/uno/arduino/HardwareSerial.d .build/uno/arduino/HardwareSerial.o: \ 2 | /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.cpp \ 3 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 4 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 5 | /usr/share/arduino/hardware/arduino/cores/arduino/WCharacter.h \ 6 | /usr/share/arduino/hardware/arduino/cores/arduino/WString.h \ 7 | /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h \ 8 | /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h \ 9 | /usr/share/arduino/hardware/arduino/cores/arduino/Print.h \ 10 | /usr/share/arduino/hardware/arduino/cores/arduino/Printable.h \ 11 | /usr/share/arduino/hardware/arduino/cores/arduino/new.h \ 12 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h \ 13 | /usr/share/arduino/hardware/arduino/cores/arduino/wiring_private.h 14 | -------------------------------------------------------------------------------- /example/.build/uno/arduino/IPAddress.d: -------------------------------------------------------------------------------- 1 | .build/uno/arduino/IPAddress.d .build/uno/arduino/IPAddress.o: \ 2 | /usr/share/arduino/hardware/arduino/cores/arduino/IPAddress.cpp \ 3 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 4 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 5 | /usr/share/arduino/hardware/arduino/cores/arduino/WCharacter.h \ 6 | /usr/share/arduino/hardware/arduino/cores/arduino/WString.h \ 7 | /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h \ 8 | /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h \ 9 | /usr/share/arduino/hardware/arduino/cores/arduino/Print.h \ 10 | /usr/share/arduino/hardware/arduino/cores/arduino/Printable.h \ 11 | /usr/share/arduino/hardware/arduino/cores/arduino/new.h \ 12 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h \ 13 | /usr/share/arduino/hardware/arduino/cores/arduino/IPAddress.h \ 14 | /usr/share/arduino/hardware/arduino/cores/arduino/Printable.h 15 | -------------------------------------------------------------------------------- /example/.build/uno/arduino/Print.d: -------------------------------------------------------------------------------- 1 | .build/uno/arduino/Print.d .build/uno/arduino/Print.o: /usr/share/arduino/hardware/arduino/cores/arduino/Print.cpp \ 2 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 3 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 4 | /usr/share/arduino/hardware/arduino/cores/arduino/WCharacter.h \ 5 | /usr/share/arduino/hardware/arduino/cores/arduino/WString.h \ 6 | /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h \ 7 | /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h \ 8 | /usr/share/arduino/hardware/arduino/cores/arduino/Print.h \ 9 | /usr/share/arduino/hardware/arduino/cores/arduino/Printable.h \ 10 | /usr/share/arduino/hardware/arduino/cores/arduino/new.h \ 11 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h 12 | -------------------------------------------------------------------------------- /example/.build/uno/arduino/Stream.d: -------------------------------------------------------------------------------- 1 | .build/uno/arduino/Stream.d .build/uno/arduino/Stream.o: /usr/share/arduino/hardware/arduino/cores/arduino/Stream.cpp \ 2 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 3 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 4 | /usr/share/arduino/hardware/arduino/cores/arduino/WCharacter.h \ 5 | /usr/share/arduino/hardware/arduino/cores/arduino/WString.h \ 6 | /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h \ 7 | /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h \ 8 | /usr/share/arduino/hardware/arduino/cores/arduino/Print.h \ 9 | /usr/share/arduino/hardware/arduino/cores/arduino/Printable.h \ 10 | /usr/share/arduino/hardware/arduino/cores/arduino/new.h \ 11 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h 12 | -------------------------------------------------------------------------------- /example/.build/uno/arduino/Tone.d: -------------------------------------------------------------------------------- 1 | .build/uno/arduino/Tone.d .build/uno/arduino/Tone.o: /usr/share/arduino/hardware/arduino/cores/arduino/Tone.cpp \ 2 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 3 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 4 | /usr/share/arduino/hardware/arduino/cores/arduino/WCharacter.h \ 5 | /usr/share/arduino/hardware/arduino/cores/arduino/WString.h \ 6 | /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h \ 7 | /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h \ 8 | /usr/share/arduino/hardware/arduino/cores/arduino/Print.h \ 9 | /usr/share/arduino/hardware/arduino/cores/arduino/Printable.h \ 10 | /usr/share/arduino/hardware/arduino/cores/arduino/new.h \ 11 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h 12 | -------------------------------------------------------------------------------- /example/.build/uno/arduino/USBCore.d: -------------------------------------------------------------------------------- 1 | .build/uno/arduino/USBCore.d .build/uno/arduino/USBCore.o: /usr/share/arduino/hardware/arduino/cores/arduino/USBCore.cpp \ 2 | /usr/share/arduino/hardware/arduino/cores/arduino/Platform.h \ 3 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 4 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 5 | /usr/share/arduino/hardware/arduino/cores/arduino/WCharacter.h \ 6 | /usr/share/arduino/hardware/arduino/cores/arduino/WString.h \ 7 | /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h \ 8 | /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h \ 9 | /usr/share/arduino/hardware/arduino/cores/arduino/Print.h \ 10 | /usr/share/arduino/hardware/arduino/cores/arduino/Printable.h \ 11 | /usr/share/arduino/hardware/arduino/cores/arduino/new.h \ 12 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h \ 13 | /usr/share/arduino/hardware/arduino/cores/arduino/USBAPI.h \ 14 | /usr/share/arduino/hardware/arduino/cores/arduino/USBDesc.h 15 | -------------------------------------------------------------------------------- /example/.build/uno/arduino/WInterrupts.d: -------------------------------------------------------------------------------- 1 | .build/uno/arduino/WInterrupts.d .build/uno/arduino/WInterrupts.o: \ 2 | /usr/share/arduino/hardware/arduino/cores/arduino/WInterrupts.c \ 3 | /usr/share/arduino/hardware/arduino/cores/arduino/wiring_private.h \ 4 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 5 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 6 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h 7 | -------------------------------------------------------------------------------- /example/.build/uno/arduino/WMath.d: -------------------------------------------------------------------------------- 1 | .build/uno/arduino/WMath.d .build/uno/arduino/WMath.o: /usr/share/arduino/hardware/arduino/cores/arduino/WMath.cpp 2 | -------------------------------------------------------------------------------- /example/.build/uno/arduino/WString.d: -------------------------------------------------------------------------------- 1 | .build/uno/arduino/WString.d .build/uno/arduino/WString.o: /usr/share/arduino/hardware/arduino/cores/arduino/WString.cpp \ 2 | /usr/share/arduino/hardware/arduino/cores/arduino/WString.h 3 | -------------------------------------------------------------------------------- /example/.build/uno/arduino/dependencies.d: -------------------------------------------------------------------------------- 1 | .build/uno/arduino/WMath.d .build/uno/arduino/WMath.o: /usr/share/arduino/hardware/arduino/cores/arduino/WMath.cpp 2 | .build/uno/arduino/wiring_shift.d .build/uno/arduino/wiring_shift.o: \ 3 | /usr/share/arduino/hardware/arduino/cores/arduino/wiring_shift.c \ 4 | /usr/share/arduino/hardware/arduino/cores/arduino/wiring_private.h \ 5 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 6 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 7 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h 8 | .build/uno/arduino/wiring_analog.d .build/uno/arduino/wiring_analog.o: \ 9 | /usr/share/arduino/hardware/arduino/cores/arduino/wiring_analog.c \ 10 | /usr/share/arduino/hardware/arduino/cores/arduino/wiring_private.h \ 11 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 12 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 13 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h 14 | .build/uno/arduino/WString.d .build/uno/arduino/WString.o: /usr/share/arduino/hardware/arduino/cores/arduino/WString.cpp \ 15 | /usr/share/arduino/hardware/arduino/cores/arduino/WString.h 16 | .build/uno/arduino/CDC.d .build/uno/arduino/CDC.o: /usr/share/arduino/hardware/arduino/cores/arduino/CDC.cpp \ 17 | /usr/share/arduino/hardware/arduino/cores/arduino/Platform.h \ 18 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 19 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 20 | /usr/share/arduino/hardware/arduino/cores/arduino/WCharacter.h \ 21 | /usr/share/arduino/hardware/arduino/cores/arduino/WString.h \ 22 | /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h \ 23 | /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h \ 24 | /usr/share/arduino/hardware/arduino/cores/arduino/Print.h \ 25 | /usr/share/arduino/hardware/arduino/cores/arduino/Printable.h \ 26 | /usr/share/arduino/hardware/arduino/cores/arduino/new.h \ 27 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h \ 28 | /usr/share/arduino/hardware/arduino/cores/arduino/USBAPI.h 29 | .build/uno/arduino/Tone.d .build/uno/arduino/Tone.o: /usr/share/arduino/hardware/arduino/cores/arduino/Tone.cpp \ 30 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 31 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 32 | /usr/share/arduino/hardware/arduino/cores/arduino/WCharacter.h \ 33 | /usr/share/arduino/hardware/arduino/cores/arduino/WString.h \ 34 | /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h \ 35 | /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h \ 36 | /usr/share/arduino/hardware/arduino/cores/arduino/Print.h \ 37 | /usr/share/arduino/hardware/arduino/cores/arduino/Printable.h \ 38 | /usr/share/arduino/hardware/arduino/cores/arduino/new.h \ 39 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h 40 | .build/uno/arduino/HardwareSerial.d .build/uno/arduino/HardwareSerial.o: \ 41 | /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.cpp \ 42 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 43 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 44 | /usr/share/arduino/hardware/arduino/cores/arduino/WCharacter.h \ 45 | /usr/share/arduino/hardware/arduino/cores/arduino/WString.h \ 46 | /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h \ 47 | /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h \ 48 | /usr/share/arduino/hardware/arduino/cores/arduino/Print.h \ 49 | /usr/share/arduino/hardware/arduino/cores/arduino/Printable.h \ 50 | /usr/share/arduino/hardware/arduino/cores/arduino/new.h \ 51 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h \ 52 | /usr/share/arduino/hardware/arduino/cores/arduino/wiring_private.h 53 | .build/uno/arduino/wiring.d .build/uno/arduino/wiring.o: /usr/share/arduino/hardware/arduino/cores/arduino/wiring.c \ 54 | /usr/share/arduino/hardware/arduino/cores/arduino/wiring_private.h \ 55 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 56 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 57 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h 58 | .build/uno/arduino/main.d .build/uno/arduino/main.o: /usr/share/arduino/hardware/arduino/cores/arduino/main.cpp \ 59 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 60 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 61 | /usr/share/arduino/hardware/arduino/cores/arduino/WCharacter.h \ 62 | /usr/share/arduino/hardware/arduino/cores/arduino/WString.h \ 63 | /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h \ 64 | /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h \ 65 | /usr/share/arduino/hardware/arduino/cores/arduino/Print.h \ 66 | /usr/share/arduino/hardware/arduino/cores/arduino/Printable.h \ 67 | /usr/share/arduino/hardware/arduino/cores/arduino/new.h \ 68 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h 69 | .build/uno/arduino/Stream.d .build/uno/arduino/Stream.o: /usr/share/arduino/hardware/arduino/cores/arduino/Stream.cpp \ 70 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 71 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 72 | /usr/share/arduino/hardware/arduino/cores/arduino/WCharacter.h \ 73 | /usr/share/arduino/hardware/arduino/cores/arduino/WString.h \ 74 | /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h \ 75 | /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h \ 76 | /usr/share/arduino/hardware/arduino/cores/arduino/Print.h \ 77 | /usr/share/arduino/hardware/arduino/cores/arduino/Printable.h \ 78 | /usr/share/arduino/hardware/arduino/cores/arduino/new.h \ 79 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h 80 | .build/uno/arduino/wiring_digital.d .build/uno/arduino/wiring_digital.o: \ 81 | /usr/share/arduino/hardware/arduino/cores/arduino/wiring_digital.c \ 82 | /usr/share/arduino/hardware/arduino/cores/arduino/wiring_private.h \ 83 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 84 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 85 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h 86 | .build/uno/arduino/IPAddress.d .build/uno/arduino/IPAddress.o: \ 87 | /usr/share/arduino/hardware/arduino/cores/arduino/IPAddress.cpp \ 88 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 89 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 90 | /usr/share/arduino/hardware/arduino/cores/arduino/WCharacter.h \ 91 | /usr/share/arduino/hardware/arduino/cores/arduino/WString.h \ 92 | /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h \ 93 | /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h \ 94 | /usr/share/arduino/hardware/arduino/cores/arduino/Print.h \ 95 | /usr/share/arduino/hardware/arduino/cores/arduino/Printable.h \ 96 | /usr/share/arduino/hardware/arduino/cores/arduino/new.h \ 97 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h \ 98 | /usr/share/arduino/hardware/arduino/cores/arduino/IPAddress.h \ 99 | /usr/share/arduino/hardware/arduino/cores/arduino/Printable.h 100 | .build/uno/arduino/Print.d .build/uno/arduino/Print.o: /usr/share/arduino/hardware/arduino/cores/arduino/Print.cpp \ 101 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 102 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 103 | /usr/share/arduino/hardware/arduino/cores/arduino/WCharacter.h \ 104 | /usr/share/arduino/hardware/arduino/cores/arduino/WString.h \ 105 | /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h \ 106 | /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h \ 107 | /usr/share/arduino/hardware/arduino/cores/arduino/Print.h \ 108 | /usr/share/arduino/hardware/arduino/cores/arduino/Printable.h \ 109 | /usr/share/arduino/hardware/arduino/cores/arduino/new.h \ 110 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h 111 | .build/uno/arduino/HID.d .build/uno/arduino/HID.o: /usr/share/arduino/hardware/arduino/cores/arduino/HID.cpp \ 112 | /usr/share/arduino/hardware/arduino/cores/arduino/Platform.h \ 113 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 114 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 115 | /usr/share/arduino/hardware/arduino/cores/arduino/WCharacter.h \ 116 | /usr/share/arduino/hardware/arduino/cores/arduino/WString.h \ 117 | /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h \ 118 | /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h \ 119 | /usr/share/arduino/hardware/arduino/cores/arduino/Print.h \ 120 | /usr/share/arduino/hardware/arduino/cores/arduino/Printable.h \ 121 | /usr/share/arduino/hardware/arduino/cores/arduino/new.h \ 122 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h \ 123 | /usr/share/arduino/hardware/arduino/cores/arduino/USBAPI.h \ 124 | /usr/share/arduino/hardware/arduino/cores/arduino/USBDesc.h 125 | .build/uno/arduino/new.d .build/uno/arduino/new.o: /usr/share/arduino/hardware/arduino/cores/arduino/new.cpp \ 126 | /usr/share/arduino/hardware/arduino/cores/arduino/new.h 127 | .build/uno/arduino/wiring_pulse.d .build/uno/arduino/wiring_pulse.o: \ 128 | /usr/share/arduino/hardware/arduino/cores/arduino/wiring_pulse.c \ 129 | /usr/share/arduino/hardware/arduino/cores/arduino/wiring_private.h \ 130 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 131 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 132 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h 133 | .build/uno/arduino/USBCore.d .build/uno/arduino/USBCore.o: /usr/share/arduino/hardware/arduino/cores/arduino/USBCore.cpp \ 134 | /usr/share/arduino/hardware/arduino/cores/arduino/Platform.h \ 135 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 136 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 137 | /usr/share/arduino/hardware/arduino/cores/arduino/WCharacter.h \ 138 | /usr/share/arduino/hardware/arduino/cores/arduino/WString.h \ 139 | /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h \ 140 | /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h \ 141 | /usr/share/arduino/hardware/arduino/cores/arduino/Print.h \ 142 | /usr/share/arduino/hardware/arduino/cores/arduino/Printable.h \ 143 | /usr/share/arduino/hardware/arduino/cores/arduino/new.h \ 144 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h \ 145 | /usr/share/arduino/hardware/arduino/cores/arduino/USBAPI.h \ 146 | /usr/share/arduino/hardware/arduino/cores/arduino/USBDesc.h 147 | .build/uno/arduino/WInterrupts.d .build/uno/arduino/WInterrupts.o: \ 148 | /usr/share/arduino/hardware/arduino/cores/arduino/WInterrupts.c \ 149 | /usr/share/arduino/hardware/arduino/cores/arduino/wiring_private.h \ 150 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 151 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 152 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h 153 | -------------------------------------------------------------------------------- /example/.build/uno/arduino/main.d: -------------------------------------------------------------------------------- 1 | .build/uno/arduino/main.d .build/uno/arduino/main.o: /usr/share/arduino/hardware/arduino/cores/arduino/main.cpp \ 2 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 3 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 4 | /usr/share/arduino/hardware/arduino/cores/arduino/WCharacter.h \ 5 | /usr/share/arduino/hardware/arduino/cores/arduino/WString.h \ 6 | /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h \ 7 | /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h \ 8 | /usr/share/arduino/hardware/arduino/cores/arduino/Print.h \ 9 | /usr/share/arduino/hardware/arduino/cores/arduino/Printable.h \ 10 | /usr/share/arduino/hardware/arduino/cores/arduino/new.h \ 11 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h 12 | -------------------------------------------------------------------------------- /example/.build/uno/arduino/new.d: -------------------------------------------------------------------------------- 1 | .build/uno/arduino/new.d .build/uno/arduino/new.o: /usr/share/arduino/hardware/arduino/cores/arduino/new.cpp \ 2 | /usr/share/arduino/hardware/arduino/cores/arduino/new.h 3 | -------------------------------------------------------------------------------- /example/.build/uno/arduino/wiring.d: -------------------------------------------------------------------------------- 1 | .build/uno/arduino/wiring.d .build/uno/arduino/wiring.o: /usr/share/arduino/hardware/arduino/cores/arduino/wiring.c \ 2 | /usr/share/arduino/hardware/arduino/cores/arduino/wiring_private.h \ 3 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 4 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 5 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h 6 | -------------------------------------------------------------------------------- /example/.build/uno/arduino/wiring_analog.d: -------------------------------------------------------------------------------- 1 | .build/uno/arduino/wiring_analog.d .build/uno/arduino/wiring_analog.o: \ 2 | /usr/share/arduino/hardware/arduino/cores/arduino/wiring_analog.c \ 3 | /usr/share/arduino/hardware/arduino/cores/arduino/wiring_private.h \ 4 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 5 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 6 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h 7 | -------------------------------------------------------------------------------- /example/.build/uno/arduino/wiring_digital.d: -------------------------------------------------------------------------------- 1 | .build/uno/arduino/wiring_digital.d .build/uno/arduino/wiring_digital.o: \ 2 | /usr/share/arduino/hardware/arduino/cores/arduino/wiring_digital.c \ 3 | /usr/share/arduino/hardware/arduino/cores/arduino/wiring_private.h \ 4 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 5 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 6 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h 7 | -------------------------------------------------------------------------------- /example/.build/uno/arduino/wiring_pulse.d: -------------------------------------------------------------------------------- 1 | .build/uno/arduino/wiring_pulse.d .build/uno/arduino/wiring_pulse.o: \ 2 | /usr/share/arduino/hardware/arduino/cores/arduino/wiring_pulse.c \ 3 | /usr/share/arduino/hardware/arduino/cores/arduino/wiring_private.h \ 4 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 5 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 6 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h 7 | -------------------------------------------------------------------------------- /example/.build/uno/arduino/wiring_shift.d: -------------------------------------------------------------------------------- 1 | .build/uno/arduino/wiring_shift.d .build/uno/arduino/wiring_shift.o: \ 2 | /usr/share/arduino/hardware/arduino/cores/arduino/wiring_shift.c \ 3 | /usr/share/arduino/hardware/arduino/cores/arduino/wiring_private.h \ 4 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 5 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 6 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h 7 | -------------------------------------------------------------------------------- /example/.build/uno/firmware.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottjgibson/RCArduinoFastLib/10949f0a8bb00af1a626ce8e310ebe27d87d9a20/example/.build/uno/firmware.elf -------------------------------------------------------------------------------- /example/.build/uno/firmware.hex: -------------------------------------------------------------------------------- 1 | :100000000C9463000C94A5050C94D2050C94050285 2 | :100010000C9432020C945F020C948B000C948B00B5 3 | :100020000C948B000C948B000C948B000C94C503E7 4 | :100030000C948B000C948B000C948B000C948B0014 5 | :100040000C94B1040C948B000C94B8060C94E90643 6 | :100050000C948B000C948B000C948B000C948B00F4 7 | :100060000C948B000C948B000000000024002700EF 8 | :100070002A0000000000250028002B0000000000DE 9 | :1000800023002600290004040404040404040202DA 10 | :100090000202020203030303030301020408102007 11 | :1000A0004080010204081020010204081020000012 12 | :1000B0000007000201000003040600000000000029 13 | :1000C00000001B03AE0711241FBECFEFD8E0DEBF38 14 | :1000D000CDBF11E0A0E0B1E0E8EDF4E102C0059091 15 | :1000E0000D92AA32B107D9F712E0AAE2B1E001C03D 16 | :1000F0001D92AC32B107E1F710E0C6ECD0E004C0CD 17 | :100100002297FE010E943309C23CD107C9F70E9421 18 | :10011000EB070C946A0A0C94000080912C01882350 19 | :1001200049F08091840090918500909353018093D1 20 | :100130005201089580918400909185002091520190 21 | :1001400030915301821B930B9695879590934D01A7 22 | :1001500080934C0180914B01816080934B01089505 23 | :1001600080912C01882349F0809184009091850032 24 | :10017000909355018093540108958091840090914B 25 | :1001800085002091540130915501821B930B969567 26 | :10019000879590934F0180934E0180914B0182602F 27 | :1001A00080934B01089580912C01882349F0809120 28 | :1001B0008400909185009093570180935601089593 29 | :1001C00080918400909185002091560130915701D3 30 | :1001D000821B930B969587959093510180935001C4 31 | :1001E00080914B01846080934B010895CF93DF93FE 32 | :1001F000FC01DB0112962C93129711965C934E939F 33 | :10020000C281D381888113969C911397892B88830F 34 | :1002100012968C911297833011F0813031F48581E0 35 | :1002200013969C911397892B858312968C91129724 36 | :100230008150823030F4868113969C911397892BDC 37 | :100240008683809168009481892B80936800DF9178 38 | :10025000CF910895EF92FF920F931F93DF93CF9367 39 | :1002600000D000D0CDB7DEB78C01FC018085918530 40 | :100270000EC07C01FC018481861731F4C801B701EE 41 | :100280000E94F60080E03EC0F701858196810097CC 42 | :1002900081F787E090E02C834A835B8369830E9427 43 | :1002A000E508DC0111961C921E9212961C92129780 44 | :1002B0002C814A815B816981009719F114966C93B6 45 | :1002C000149712962C93129716961C921E921597BD 46 | :1002D000E62FF0E0E656FF4FE4911396EC93139768 47 | :1002E000F80180859185009719F4B187A08703C034 48 | :1002F000F701B683A583C801BD010E94F60081E025 49 | :1003000001C08FEF0F900F900F900F90CF91DF9162 50 | :100310001F910F91FF90EF900895CF93DF93382FA7 51 | :10032000DB01242FE82FF0E0EA57FF4FE491EE23A2 52 | :10033000D9F01097C9F0F0E03297E330F10540F4BE 53 | :10034000EE0FFF1FEC5EFE4F0190F081E02D02C02A 54 | :10035000E0E0F0E0C081D18188818783CF01632F05 55 | :10036000AD010E942A0101C08FEFDF91CF91089566 56 | :10037000FF920F931F93CF93DF93EC0120912A01FB 57 | :100380008F813D8190912A014E81F0902A01F09455 58 | :10039000F4229323F92A8227F82280912A018F835D 59 | :1003A000088519851CC0D80113969C9113978F2D31 60 | :1003B000892381F080912A01892391E009F490E05A 61 | :1003C00090932C01F801848180932B010190F0819E 62 | :1003D000E02D0995D80115960D911C9116970115E0 63 | :1003E000110509F78BB39C81892349F08BB3892BC5 64 | :1003F0008BBBE881F981808180932A01BFCFDF9197 65 | :10040000CF911F910F91FF9008951F920F920FB6F9 66 | :100410000F9211242F933F934F935F936F937F938A 67 | :100420008F939F93AF93BF93EF93FF93E0912D0131 68 | :10043000F0912E01808180932A018DE291E00E944B 69 | :10044000B801FF91EF91BF91AF919F918F917F91F3 70 | :100450006F915F914F913F912F910F900FBE0F9031 71 | :100460001F9018951F920F920FB60F9211242F9381 72 | :100470003F934F935F936F937F938F939F93AF932C 73 | :10048000BF93EF93FF93E0913701F09138018081A2 74 | :1004900080932A0187E391E00E94B801FF91EF91D8 75 | :1004A000BF91AF919F918F917F916F915F914F918C 76 | :1004B0003F912F910F900FBE0F901F9018951F9294 77 | :1004C0000F920FB60F9211242F933F934F935F9388 78 | :1004D0006F937F938F939F93AF93BF93EF93FF930C 79 | :1004E000E0914101F0914201808180932A0181E4F1 80 | :1004F00091E00E94B801FF91EF91BF91AF919F9160 81 | :100500008F917F916F915F914F913F912F910F90BC 82 | :100510000FBE0F901F901895CF93DF93C9E0D2E0E4 83 | :10052000CE0140E052EC61E070E00E943007CE0165 84 | :1005300060E071E00E94520880E068E00E940A04D6 85 | :1005400081E069E00E940A0482E06AE00E940A04F5 86 | :1005500083E060EB76E30E9467040E947C0485E000 87 | :100560006DE870E041E050E00E948D0186E060EBB4 88 | :1005700070E041E050E00E948D0187E063ED70E0A3 89 | :1005800041E050E00E948D01DF91CF91089580916C 90 | :100590004B01882331F1F89420914B0120935801AD 91 | :1005A00020FF08C080914C0190914D0190935E0115 92 | :1005B00080935D0121FF08C080914E0190914F0111 93 | :1005C00090935C0180935B0122FF08C080915001F1 94 | :1005D0009091510190935A018093590110924B01CF 95 | :1005E00078948091580180FF07C060915D017091FF 96 | :1005F0005E0180E00E94E9038091580181FF07C0FD 97 | :1006000060915B0170915C0181E00E94E90380913F 98 | :10061000580182FF07C06091590170915A0182E030 99 | :100620000E94E90364EF71E080E090E00E941F0502 100 | :1006300010925801089580E890E0FC0125913491D2 101 | :1006400020932D0130932E012BE630E030933001C2 102 | :1006500020932F0121E0209331011092320110925A 103 | :1006600033011092360110923501FC01329625912A 104 | :10067000349120933701309338012CE630E03093E9 105 | :100680003A012093390122E020933B0110923C0172 106 | :1006900010923D011092400110923F010496FC011E 107 | :1006A0002591349120934101309342018DE690E0F1 108 | :1006B000909344018093430184E08093450110921C 109 | :1006C00046011092470110924A0110924901089583 110 | :1006D0008091730190E0FC01EE0FFF1FEE0FFF1FF2 111 | :1006E000E80FF91FE15AFE4F8281882331F0A08183 112 | :1006F000B1818C919281892B8C93089580917301A3 113 | :10070000843080F010927301809170018823F1F0A1 114 | :10071000E0916E01F0916F018081909170018927C5 115 | :10072000808314C0815090E0FC01EE0FFF1FEE0F9C 116 | :10073000FF1FE80FF91FE15AFE4F8281882331F035 117 | :10074000A081B1818C91928189278C930E9468034A 118 | :10075000209184003091850040917301842F90E0B6 119 | :10076000FC01EE0FFF1FEE0FFF1FE80FF91FE15A0C 120 | :10077000FE4F83819481820F931F90938900809311 121 | :1007800088004F5F4093730108951F920F920FB638 122 | :100790000F9211242F933F934F935F936F937F9307 123 | :1007A0008F939F93AF93BF93EF93FF930E947E032A 124 | :1007B000FF91EF91BF91AF919F918F917F916F9139 125 | :1007C0005F914F913F912F910F900FBE0F901F900F 126 | :1007D00018958530F0F493E0683E790738F097E09B 127 | :1007E000613D790728F060ED77E002C068EE73E0C4 128 | :1007F000660F771F2FB7F89490E0FC01EE0FFF1FF4 129 | :10080000EE0FFF1FE80FF91FE15AFE4F7483638359 130 | :100810002FBF0895282F862F243008F057C09FB788 131 | :10082000F89430E0F901EE0FFF1FEE0FFF1FE20F0B 132 | :10083000F31FE15AFE4F48EB5BE05483438368307B 133 | :1008400038F06E3040F0643148F040E050E008C0CD 134 | :100850004BE250E005C045E250E002C048E250E003 135 | :10086000F901EE0FFF1FEE0FFF1FE20FF31FE15A1A 136 | :10087000FE4F518340838431D0F4883048F441E006 137 | :1008800050E0082E02C0440F551F0A94E2F710C032 138 | :100890008E3018F4682F685002C0682F6E5041E007 139 | :1008A00050E002C0440F551F6A95E2F701C04FEFB8 140 | :1008B000F901EE0FFF1FEE0FFF1FE20FF31FE15ACA 141 | :1008C000FE4F42839FBF61E00E94810508952FB7CC 142 | :1008D000F89490E0660F771FFC01EE0FFF1FEE0FFC 143 | :1008E000FF1FE80FF91FE15AFE4F748363831182E3 144 | :1008F000108212822FBF0895CF93DF93109285004C 145 | :10090000109284001092800082E080938100B19A5E 146 | :1009100080916F00826080936F008091840090913D 147 | :1009200085008056904F9093890080938800C0E0A6 148 | :10093000D0E0FE01EE0FFF1FEE0FFF1FEC0FFD1FBB 149 | :10094000E15AFE4F6381748189E092E04AE050E011 150 | :100950000E94CE082196C430D10559F7DF91CF917E 151 | :1009600008951F920F920FB60F9211242F933F9369 152 | :100970008F939F93AF93BF9380917801909179016A 153 | :10098000A0917A01B0917B0130917C010196A11D6B 154 | :10099000B11D232F2D5F2D3720F02D570196A11D5E 155 | :1009A000B11D20937C018093780190937901A093ED 156 | :1009B0007A01B0937B018091740190917501A091AF 157 | :1009C0007601B09177010196A11DB11D809374014C 158 | :1009D00090937501A0937601B0937701BF91AF9189 159 | :1009E0009F918F913F912F910F900FBE0F901F906D 160 | :1009F00018959FB7F894209174013091750140913A 161 | :100A000076015091770186B5A89B06C08F3F21F0F3 162 | :100A10002F5F3F4F4F4F5F4F9FBF542F432F322FBA 163 | :100A20002227280F311D411D511D82E0220F331F47 164 | :100A3000441F551F8A95D1F7B901CA010895EF9255 165 | :100A4000FF920F931F93CF93DF937B018C010E9442 166 | :100A5000F904EB010FC00E94F9046C1B7D0B83E0CD 167 | :100A6000683E780738F00894E108F1080109110997 168 | :100A7000C851DC4FE114F1040105110561F7DF9164 169 | :100A8000CF911F910F91FF90EF900895789484B5C6 170 | :100A9000826084BD84B5816084BD85B5826085BD7A 171 | :100AA00085B5816085BDEEE6F0E080818160808360 172 | :100AB000E1E8F0E010828081826080838081816043 173 | :100AC0008083E0E8F0E0808181608083E1EBF0E00A 174 | :100AD000808184608083E0EBF0E0808181608083AE 175 | :100AE000EAE7F0E080818460808380818260808397 176 | :100AF0008081816080838081806880831092C100C2 177 | :100B0000089590E0FC01E656FF4F2491FC01EA575E 178 | :100B1000FF4FE491EE23C1F0F0E0EE0FFF1FE85924 179 | :100B2000FF4F85919491DC01662341F49FB7F894BF 180 | :100B30008C91209582238C939FBF08959FB7F89442 181 | :100B40008C91822B8C939FBF08951F920F920FB6AA 182 | :100B50000F9211242F933F934F935F936F937F9343 183 | :100B60008F939F93AF93BF93EF93FF9380917D01FA 184 | :100B700090917E01009729F0E0917D01F0917E0136 185 | :100B80000995FF91EF91BF91AF919F918F917F91C7 186 | :100B90006F915F914F913F912F910F900FBE0F90EA 187 | :100BA0001F9018951F920F920FB60F9211242F933A 188 | :100BB0003F934F935F936F937F938F939F93AF93E5 189 | :100BC000BF93EF93FF9380917F01909180010097F5 190 | :100BD00029F0E0917F01F09180010995FF91EF915B 191 | :100BE000BF91AF919F918F917F916F915F914F9145 192 | :100BF0003F912F910F900FBE0F901F901895FC0101 193 | :100C000084859585FC01E05CFF4F208131818E5BFE 194 | :100C10009F4FFC0180819181281B390B2F7330700D 195 | :100C2000C9010895FC0184859585FC01E05CFF4FB6 196 | :100C300040815181FC01EE5BFF4F208131814217E1 197 | :100C4000530741F00190F081E02DE80FF91F20815A 198 | :100C500030E002C02FEF3FEFC9010895FC01848509 199 | :100C60009585FC01E05CFF4F40815181FC01EE5B0A 200 | :100C7000FF4F208131814217530771F0A081B1816C 201 | :100C8000A80FB91F2C918081918101968F7390706C 202 | :100C90009183808330E002C02FEF3FEFC9010895B8 203 | :100CA000DC011E968D919C911F97FC01E05CFF4F2B 204 | :100CB0008E5B9F4F40815181DC012D913C911197BA 205 | :100CC00042175307B9F708951F93FC01162F268585 206 | :100CD0003785D901A05CBF4F8D919C91019660E44E 207 | :100CE00070E00E94E808D901AE5BBF4F4D915C9166 208 | :100CF000119784179507D1F3D901A05CBF4F0D90D0 209 | :100D0000BC91A02DA20FB31F1C93A685B785A05C34 210 | :100D1000BF4F11969C938E93A689B7892C9181E041 211 | :100D200090E0058C02C0880F991F0A94E2F7282BE7 212 | :100D30002C9381E090E01F910895FB01E05CFF4F50 213 | :100D4000208131812F5F3F4F2F733070DB01AE5B0D 214 | :100D5000BF4F4D915C9111972417350739F0A08151 215 | :100D6000B181A60FB71F8C93318320830895089516 216 | :100D70001F920F920FB60F9211242F933F934F9310 217 | :100D80005F936F937F938F939F93AF93BF93EF93F3 218 | :100D9000FF938091C60061E871E00E949D06FF917B 219 | :100DA000EF91BF91AF919F918F917F916F915F91E3 220 | :100DB0004F913F912F910F900FBE0F901F9018955C 221 | :100DC00089E092E00E94FF05009711F00E94B706AB 222 | :100DD00008951F920F920FB60F9211242F933F93F5 223 | :100DE0005F936F937F938F939F93AF93BF93EF9393 224 | :100DF000FF932091050230910602809107029091A5 225 | :100E000008022817390731F48091C1008F7D809343 226 | :100E1000C10016C0E0910702F0910802EB53FE4FAB 227 | :100E200020818091070290910802019660E470E0B1 228 | :100E30000E94E80890930802809307022093C6005E 229 | :100E4000FF91EF91BF91AF919F918F917F916F91A2 230 | :100E50005F913F912F910F900FBE0F901F901895AB 231 | :100E6000DF92EF92FF920F931F93CF93DF93EC01EA 232 | :100E70007A018B01DD24D394403081EE580780E065 233 | :100E8000680780E0780749F4DD24EC89FD89108249 234 | :100E900060E874E88EE190E00FC0EC89FD8981E0A4 235 | :100EA00090E00E8C02C0880F991F0A94E2F78083AD 236 | :100EB00060E079E08DE390E0A80197010E94FB08D3 237 | :100EC00021503040404050405695479537952795E2 238 | :100ED00080E12030380710F0DD20B1F6E889F9898B 239 | :100EE0003083EA89FB892083EE89FF89408181E094 240 | :100EF00090E09C010A8C02C0220F331F0A94E2F793 241 | :100F0000422B4083EE89FF8940819C010B8C02C0FB 242 | :100F1000220F331F0A94E2F7422B4083EE89FF89A8 243 | :100F200040819C010C8C02C0220F331F0A94E2F70F 244 | :100F3000422B4083EE89FF8920810D8C02C0880FEF 245 | :100F4000991F0A94E2F7809582238083DF91CF91E5 246 | :100F50001F910F91FF90EF90DF90089510920C0277 247 | :100F600010920B0288EE93E0A0E0B0E080930D02B7 248 | :100F700090930E02A0930F02B0931002EBE0F2E008 249 | :100F80008EE191E09293829381E891E09587848746 250 | :100F900085EC91E09787868785EC90E0918B808B3C 251 | :100FA00084EC90E0938B828B80EC90E0958B848B2B 252 | :100FB00081EC90E0978B868B86EC90E0918F808F10 253 | :100FC00084E0828F83E0838F87E0848F85E0858F44 254 | :100FD00081E0868F0895CF93DF930E9446050E949B 255 | :100FE0008C02C0EED6E00E94C7022097E1F30E9477 256 | :100FF000E006F9CFCF92DF92EF92FF920F931F930B 257 | :10100000CF93DF936C017B018A01C0E0D0E00FC079 258 | :10101000D7016D917D01D601ED91FC910190F08198 259 | :10102000E02DC6010995C80FD91F015010400115C8 260 | :10103000110571F7CE01DF91CF911F910F91FF90B4 261 | :10104000EF90DF90CF900895DB010D900020E9F73D 262 | :10105000AD0141505040461B570BDC01ED91FC9116 263 | :101060000280F381E02D09950895DC01ED91FC915A 264 | :101070000190F081E02D099508950F931F93CF9370 265 | :10108000DF93EC016DE00E9435088C01CE016AE02F 266 | :101090000E943508080F191FC801DF91CF911F91D9 267 | :1010A0000F9108950F931F93CF93DF93EC010E944C 268 | :1010B00024088C01CE010E943D08080F191FC801A9 269 | :1010C000DF91CF911F910F9108958F929F92AF92D0 270 | :1010D000BF92CF92DF92EF92FF920F931F93DF9315 271 | :1010E000CF93CDB7DEB7A1970FB6F894DEBF0FBE92 272 | :1010F000CDBF6C01042FE52FCB01122F19A2223096 273 | :1011000008F41AE021E2E22EF12CEC0EFD1E812EF5 274 | :101110009924AA24BB2403C0022FE32FCA01602F05 275 | :101120007E2FA50194010E94FB08129F802D11249F 276 | :10113000081B0894E108F1080A3014F4005D01C0AE 277 | :10114000095CF7010083211531054105510521F79F 278 | :10115000C601B7010E942408A1960FB6F894DEBF1D 279 | :101160000FBECDBFCF91DF911F910F91FF90EF90F8 280 | :10117000DF90CF90BF90AF909F908F9008952115F2 281 | :10118000310549F4DC01ED91FC910190F081E02DF5 282 | :10119000642F099508950E94650808950F931F9381 283 | :1011A000CF93DF93EC019A01AB0160E070E00E9405 284 | :1011B000BF088C01CE010E943D08080F191FC8010D 285 | :1011C000DF91CF911F910F9108950E9437090895E3 286 | :1011D00097FB092E07260AD077FD04D02ED006D023 287 | :1011E00000201AF4709561957F4F0895F6F7909559 288 | :1011F00081959F4F0895A1E21A2EAA1BBB1BFD01EA 289 | :101200000DC0AA1FBB1FEE1FFF1FA217B307E407E5 290 | :10121000F50720F0A21BB30BE40BF50B661F771F3D 291 | :10122000881F991F1A9469F760957095809590951D 292 | :101230009B01AC01BD01CF010895AA1BBB1B51E16D 293 | :1012400007C0AA1FBB1FA617B70710F0A61BB70B36 294 | :10125000881F991F5A95A9F780959095BC01CD01DB 295 | :101260000895EE0FFF1F0590F491E02D0994CF93A0 296 | :10127000DF938230910510F482E090E0E0912A0241 297 | :10128000F0912B0240E050E020E030E026C0608189 298 | :10129000718168177907E0F06817790781F4828116 299 | :1012A00093812115310531F0D90113969C938E93CA 300 | :1012B00012972BC090932B0280932A0226C04115CF 301 | :1012C000510519F06417750718F4AB01E901DF0146 302 | :1012D0009F0172816381E72FF62F3097C1F6411588 303 | :1012E000510501F1481B590B4430510580F4129609 304 | :1012F0008D919C911397209719F09B838A8304C04A 305 | :1013000090932B0280932A02FD01329646C0FD0184 306 | :10131000E40FF51F819391934250504011965C93D6 307 | :101320004E933BC0209128023091290221153105AE 308 | :1013300041F4209110013091110130932902209342 309 | :10134000280220911201309113012115310541F439 310 | :101350002DB73EB740910E0150910F01241B350B64 311 | :10136000E0912802F0912902E217F307A0F42E1B66 312 | :101370003F0B2817390778F0AC014E5F5F4F2417F9 313 | :10138000350748F04E0F5F1F509329024093280203 314 | :101390008193919302C0E0E0F0E0CF01DF91CF9123 315 | :1013A0000895CF93DF93009709F491C0FC01329721 316 | :1013B0001382128260912A0270912B0261157105CD 317 | :1013C00081F420813181280F391F8091280290916A 318 | :1013D00029028217930799F5F0932902E0932802D6 319 | :1013E00076C0DB0180E090E002C0CD01D901AE17EC 320 | :1013F000BF0748F412962D913C91139721153105A2 321 | :10140000A1F7CD0121C0B383A283EF014991599186 322 | :101410009E01240F351FA217B30779F42D913C913B 323 | :101420001197240F351F2E5F3F4F31832083129673 324 | :101430002D913C91139733832283009729F4F093E5 325 | :101440002B02E0932A0243C0DC011396FC93EE9337 326 | :1014500012974D915D91A40FB51FEA17FB0769F430 327 | :1014600020813181240F351F2E5F3F4FEC013983DE 328 | :101470002883228133813B832A83E0E0F0E002C0AD 329 | :10148000FB01BC01DB0112968D919C911397009793 330 | :10149000B9F79B012E5F3F4F8D919C911197820F61 331 | :1014A000931F40912802509129024817590779F457 332 | :1014B000309729F410922B0210922A0202C0138254 333 | :1014C0001282225030403093290220932802DF916B 334 | :0814D000CF910895F894FFCFBD 335 | :1014D8006D756C74694368616E6E656C730020008D 336 | :1014E8002C0200002D0137014101000000006406B4 337 | :0A14F800FA07FF052E061206500643 338 | :00000001FF 339 | -------------------------------------------------------------------------------- /example/.build/uno/src/dependencies.d: -------------------------------------------------------------------------------- 1 | .build/uno/src/sketch.d .build/uno/src/sketch.o: .build/uno/src/sketch.cpp \ 2 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 3 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 4 | /usr/share/arduino/hardware/arduino/cores/arduino/WCharacter.h \ 5 | /usr/share/arduino/hardware/arduino/cores/arduino/WString.h \ 6 | /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h \ 7 | /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h \ 8 | /usr/share/arduino/hardware/arduino/cores/arduino/Print.h \ 9 | /usr/share/arduino/hardware/arduino/cores/arduino/Printable.h \ 10 | /usr/share/arduino/hardware/arduino/cores/arduino/new.h \ 11 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h \ 12 | lib/RCArduinoFastLib/RCArduinoFastLib.h lib/PinChangeInt/PinChangeInt.h \ 13 | /usr/share/arduino/hardware/arduino/cores/arduino/wiring_private.h \ 14 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h 15 | -------------------------------------------------------------------------------- /example/.build/uno/src/sketch.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | void setup(); 3 | void loop(); 4 | void calcThrottle(); 5 | void calcSteering(); 6 | void calcAux(); 7 | #line 1 "src/sketch.ino" 8 | #include 9 | 10 | // MultiChannels 11 | // 12 | // rcarduino.blogspot.com 13 | // 14 | // A simple approach for reading three RC Channels using pin change interrupts 15 | // 16 | // See related posts - 17 | // http://rcarduino.blogspot.co.uk/2012/01/how-to-read-rc-receiver-with.html 18 | // http://rcarduino.blogspot.co.uk/2012/03/need-more-interrupts-to-read-more.html 19 | // http://rcarduino.blogspot.co.uk/2012/01/can-i-control-more-than-x-servos-with.html 20 | // 21 | // rcarduino.blogspot.com 22 | // 23 | 24 | // include the pinchangeint library - see the links in the related topics section above for details 25 | #include 26 | 27 | // Assign your channel in pins 28 | #define THROTTLE_IN_PIN 5 29 | #define STEERING_IN_PIN 6 30 | #define AUX_IN_PIN 7 31 | 32 | // Assign your channel out pins 33 | #define THROTTLE_OUT_PIN 8 34 | #define STEERING_OUT_PIN 9 35 | #define AUX_OUT_PIN 10 36 | 37 | // Assign servo indexes 38 | #define SERVO_THROTTLE 0 39 | #define SERVO_STEERING 1 40 | #define SERVO_AUX 2 41 | #define SERVO_FRAME_SPACE 3 42 | 43 | // These bit flags are set in bUpdateFlagsShared to indicate which 44 | // channels have new signals 45 | #define THROTTLE_FLAG 1 46 | #define STEERING_FLAG 2 47 | #define AUX_FLAG 4 48 | 49 | // holds the update flags defined above 50 | volatile uint8_t bUpdateFlagsShared; 51 | 52 | // shared variables are updated by the ISR and read by loop. 53 | // In loop we immediatley take local copies so that the ISR can keep ownership of the 54 | // shared ones. To access these in loop 55 | // we first turn interrupts off with noInterrupts 56 | // we take a copy to use in loop and the turn interrupts back on 57 | // as quickly as possible, this ensures that we are always able to receive new signals 58 | volatile uint16_t unThrottleInShared; 59 | volatile uint16_t unSteeringInShared; 60 | volatile uint16_t unAuxInShared; 61 | 62 | // These are used to record the rising edge of a pulse in the calcInput functions 63 | // They do not need to be volatile as they are only used in the ISR. If we wanted 64 | // to refer to these in loop and the ISR then they would need to be declared volatile 65 | uint16_t unThrottleInStart; 66 | uint16_t unSteeringInStart; 67 | uint16_t unAuxInStart; 68 | 69 | uint16_t unLastAuxIn = 0; 70 | uint32_t ulVariance = 0; 71 | uint32_t ulGetNextSampleMillis = 0; 72 | uint16_t unMaxDifference = 0; 73 | 74 | void setup() 75 | { 76 | Serial.begin(115200); 77 | 78 | Serial.println("multiChannels"); 79 | 80 | // attach servo objects, these will generate the correct 81 | // pulses for driving Electronic speed controllers, servos or other devices 82 | // designed to interface directly with RC Receivers 83 | CRCArduinoFastServos::attach(SERVO_THROTTLE,THROTTLE_OUT_PIN); 84 | CRCArduinoFastServos::attach(SERVO_STEERING,STEERING_OUT_PIN); 85 | CRCArduinoFastServos::attach(SERVO_AUX,AUX_OUT_PIN); 86 | 87 | // lets set a standard rate of 50 Hz by setting a frame space of 10 * 2000 = 3 Servos + 7 times 2000 88 | CRCArduinoFastServos::setFrameSpaceA(SERVO_FRAME_SPACE,7*2000); 89 | 90 | CRCArduinoFastServos::begin(); 91 | 92 | // using the PinChangeInt library, attach the interrupts 93 | // used to read the channels 94 | PCintPort::attachInterrupt(THROTTLE_IN_PIN, calcThrottle,CHANGE); 95 | PCintPort::attachInterrupt(STEERING_IN_PIN, calcSteering,CHANGE); 96 | PCintPort::attachInterrupt(AUX_IN_PIN, calcAux,CHANGE); 97 | } 98 | 99 | void loop() 100 | { 101 | // create local variables to hold a local copies of the channel inputs 102 | // these are declared static so that thier values will be retained 103 | // between calls to loop. 104 | static uint16_t unThrottleIn; 105 | static uint16_t unSteeringIn; 106 | static uint16_t unAuxIn; 107 | // local copy of update flags 108 | static uint8_t bUpdateFlags; 109 | 110 | // check shared update flags to see if any channels have a new signal 111 | if(bUpdateFlagsShared) 112 | { 113 | noInterrupts(); // turn interrupts off quickly while we take local copies of the shared variables 114 | 115 | // take a local copy of which channels were updated in case we need to use this in the rest of loop 116 | bUpdateFlags = bUpdateFlagsShared; 117 | 118 | // in the current code, the shared values are always populated 119 | // so we could copy them without testing the flags 120 | // however in the future this could change, so lets 121 | // only copy when the flags tell us we can. 122 | 123 | if(bUpdateFlags & THROTTLE_FLAG) 124 | { 125 | unThrottleIn = unThrottleInShared; 126 | } 127 | 128 | if(bUpdateFlags & STEERING_FLAG) 129 | { 130 | unSteeringIn = unSteeringInShared; 131 | } 132 | 133 | if(bUpdateFlags & AUX_FLAG) 134 | { 135 | unAuxIn = unAuxInShared; 136 | } 137 | 138 | // clear shared copy of updated flags as we have already taken the updates 139 | // we still have a local copy if we need to use it in bUpdateFlags 140 | bUpdateFlagsShared = 0; 141 | 142 | interrupts(); // we have local copies of the inputs, so now we can turn interrupts back on 143 | // as soon as interrupts are back on, we can no longer use the shared copies, the interrupt 144 | // service routines own these and could update them at any time. During the update, the 145 | // shared copies may contain junk. Luckily we have our local copies to work with :-) 146 | } 147 | 148 | // do any processing from here onwards 149 | // only use the local values unAuxIn, unThrottleIn and unSteeringIn, the shared 150 | // variables unAuxInShared, unThrottleInShared, unSteeringInShared are always owned by 151 | // the interrupt routines and should not be used in loop 152 | 153 | // the following code provides simple pass through 154 | // this is a good initial test, the Arduino will pass through 155 | // receiver input as if the Arduino is not there. 156 | // This should be used to confirm the circuit and power 157 | // before attempting any custom processing in a project. 158 | 159 | // we are checking to see if the channel value has changed, this is indicated 160 | // by the flags. For the simple pass through we don't really need this check, 161 | // but for a more complex project where a new signal requires significant processing 162 | // this allows us to only calculate new values when we have new inputs, rather than 163 | // on every cycle. 164 | if(bUpdateFlags & THROTTLE_FLAG) 165 | { 166 | CRCArduinoFastServos::writeMicroseconds(SERVO_THROTTLE,unThrottleIn); 167 | } 168 | 169 | if(bUpdateFlags & STEERING_FLAG) 170 | { 171 | CRCArduinoFastServos::writeMicroseconds(SERVO_STEERING,unSteeringIn); 172 | } 173 | 174 | if(bUpdateFlags & AUX_FLAG) 175 | { 176 | CRCArduinoFastServos::writeMicroseconds(SERVO_AUX,unAuxIn); 177 | } 178 | 179 | delay(500); 180 | bUpdateFlags = 0; 181 | } 182 | 183 | 184 | // simple interrupt service routine 185 | void calcThrottle() 186 | { 187 | if(PCintPort::pinState) 188 | { 189 | unThrottleInStart = TCNT1; 190 | } 191 | else 192 | { 193 | unThrottleInShared = (TCNT1 - unThrottleInStart)>>1; 194 | bUpdateFlagsShared |= THROTTLE_FLAG; 195 | } 196 | } 197 | 198 | void calcSteering() 199 | { 200 | if(PCintPort::pinState) 201 | { 202 | unSteeringInStart = TCNT1; 203 | } 204 | else 205 | { 206 | unSteeringInShared = (TCNT1 - unSteeringInStart)>>1; 207 | 208 | bUpdateFlagsShared |= STEERING_FLAG; 209 | } 210 | } 211 | 212 | void calcAux() 213 | { 214 | if(PCintPort::pinState) 215 | { 216 | unAuxInStart = TCNT1; 217 | } 218 | else 219 | { 220 | unAuxInShared = (TCNT1 - unAuxInStart)>>1; 221 | bUpdateFlagsShared |= AUX_FLAG; } 222 | } 223 | 224 | -------------------------------------------------------------------------------- /example/.build/uno/src/sketch.d: -------------------------------------------------------------------------------- 1 | .build/uno/src/sketch.d .build/uno/src/sketch.o: .build/uno/src/sketch.cpp \ 2 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h \ 3 | /usr/share/arduino/hardware/arduino/cores/arduino/binary.h \ 4 | /usr/share/arduino/hardware/arduino/cores/arduino/WCharacter.h \ 5 | /usr/share/arduino/hardware/arduino/cores/arduino/WString.h \ 6 | /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h \ 7 | /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h \ 8 | /usr/share/arduino/hardware/arduino/cores/arduino/Print.h \ 9 | /usr/share/arduino/hardware/arduino/cores/arduino/Printable.h \ 10 | /usr/share/arduino/hardware/arduino/cores/arduino/new.h \ 11 | /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h \ 12 | lib/RCArduinoFastLib/RCArduinoFastLib.h lib/PinChangeInt/PinChangeInt.h \ 13 | /usr/share/arduino/hardware/arduino/cores/arduino/wiring_private.h \ 14 | /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h 15 | -------------------------------------------------------------------------------- /example/lib/.holder: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottjgibson/RCArduinoFastLib/10949f0a8bb00af1a626ce8e310ebe27d87d9a20/example/lib/.holder -------------------------------------------------------------------------------- /example/lib/PinChangeInt/Examples/ByteBuffer/ByteBuffer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ByteBuffer.cpp - A circular buffer implementation for Arduino 3 | Created by Sigurdur Orn, July 19, 2010. 4 | siggi@mit.edu 5 | Updated by GreyGnome (aka Mike Schwager) Thu Feb 23 17:25:14 CST 2012 6 | added the putString() method and the fillError variable. 7 | added the checkError() and resetError() methods. The checkError() method resets the fillError variable 8 | to false as a side effect. 9 | added the ByteBuffer(unsigned int buf_size) constructor. 10 | added the init() method, and had the constructor call it automagically. 11 | Also made the capacity, position, length, and fillError variables volatile, for safe use by interrupts. 12 | */ 13 | 14 | #include "ByteBuffer.h" 15 | 16 | void ByteBuffer::init(){ 17 | ByteBuffer::init(DEFAULTBUFSIZE); 18 | } 19 | 20 | void ByteBuffer::init(unsigned int buf_length){ 21 | data = (byte*)malloc(sizeof(byte)*buf_length); 22 | capacity = buf_length; 23 | position = 0; 24 | length = 0; 25 | fillError=false; 26 | } 27 | 28 | void ByteBuffer::deAllocate(){ 29 | free(data); 30 | } 31 | 32 | void ByteBuffer::clear(){ 33 | position = 0; 34 | length = 0; 35 | } 36 | 37 | void ByteBuffer::resetError(){ 38 | fillError=false; 39 | } 40 | 41 | boolean ByteBuffer::checkError(){ 42 | /* 43 | if (fillError) { 44 | Serial.print("E: checkError: length "); 45 | Serial.println(length, DEC); 46 | } 47 | */ 48 | 49 | boolean result=fillError; 50 | fillError=false; 51 | return(result); 52 | } 53 | 54 | int ByteBuffer::getSize(){ 55 | return length; 56 | } 57 | 58 | int ByteBuffer::getCapacity(){ 59 | return capacity; 60 | } 61 | 62 | byte ByteBuffer::peek(unsigned int index){ 63 | byte b = data[(position+index)%capacity]; 64 | return b; 65 | } 66 | 67 | uint8_t ByteBuffer::put(byte in){ 68 | if(length < capacity){ 69 | // save data byte at end of buffer 70 | data[(position+length) % capacity] = in; 71 | // increment the length 72 | length++; 73 | return 1; 74 | } 75 | // return failure 76 | //Serial.print("E: put: "); 77 | //Serial.println(length, DEC); 78 | fillError=true; 79 | return 0; 80 | } 81 | 82 | 83 | uint8_t ByteBuffer::putString(char *in){ 84 | uint8_t count=0; 85 | char *inString; 86 | 87 | inString=in; 88 | uint8_t oldSREG = SREG; cli(); 89 | while(length <= capacity){ 90 | if (length == capacity) { 91 | fillError=true; 92 | return count; 93 | } 94 | // save data byte at end of buffer 95 | data[(position+length) % capacity] = *inString; 96 | // increment the length 97 | length++; 98 | inString++; 99 | count++; 100 | if (*inString == 0) { 101 | if (count==0) fillError=true; // Serial.println("E: putString"); }; 102 | SREG = oldSREG; // Restore register; reenables interrupts 103 | return count; 104 | } 105 | } 106 | SREG = oldSREG; // Restore register; reenables interrupts 107 | return count; 108 | } 109 | 110 | uint8_t ByteBuffer::putInFront(byte in){ 111 | uint8_t oldSREG = SREG; cli(); 112 | if(length < capacity){ 113 | // save data byte at end of buffer 114 | if( position == 0 ) 115 | position = capacity-1; 116 | else 117 | position = (position-1)%capacity; 118 | data[position] = in; 119 | // increment the length 120 | length++; 121 | SREG = oldSREG; // Restore register; reenables interrupts 122 | return 1; 123 | } 124 | // return failure 125 | //Serial.println("E: putInFront"); 126 | fillError=true; 127 | SREG = oldSREG; // Restore register; reenables interrupts 128 | return 0; 129 | } 130 | 131 | byte ByteBuffer::get(){ 132 | uint8_t oldSREG = SREG; cli(); 133 | byte b = 0; 134 | 135 | if(length > 0){ 136 | b = data[position]; 137 | // move index down and decrement length 138 | position = (position+1)%capacity; 139 | length--; 140 | } 141 | SREG = oldSREG; // Restore register; reenables interrupts 142 | return b; 143 | } 144 | 145 | byte ByteBuffer::getFromBack(){ 146 | byte b = 0; 147 | if(length > 0){ 148 | uint8_t oldSREG = SREG; cli(); 149 | b = data[(position+length-1)%capacity]; 150 | length--; 151 | SREG = oldSREG; // Restore register; reenables interrupts 152 | } 153 | 154 | return b; 155 | } 156 | 157 | // 158 | // Ints 159 | // 160 | 161 | void ByteBuffer::putIntInFront(int in){ 162 | byte *pointer = (byte *)∈ 163 | putInFront(pointer[0]); 164 | putInFront(pointer[1]); 165 | } 166 | 167 | void ByteBuffer::putInt(int in){ 168 | byte *pointer = (byte *)∈ 169 | put(pointer[1]); 170 | put(pointer[0]); 171 | } 172 | 173 | 174 | int ByteBuffer::getInt(){ 175 | int ret; 176 | byte *pointer = (byte *)&ret; 177 | pointer[1] = get(); 178 | pointer[0] = get(); 179 | return ret; 180 | } 181 | 182 | int ByteBuffer::getIntFromBack(){ 183 | int ret; 184 | byte *pointer = (byte *)&ret; 185 | pointer[0] = getFromBack(); 186 | pointer[1] = getFromBack(); 187 | return ret; 188 | } 189 | 190 | // 191 | // Longs 192 | // 193 | 194 | void ByteBuffer::putLongInFront(long in){ 195 | byte *pointer = (byte *)∈ 196 | putInFront(pointer[0]); 197 | putInFront(pointer[1]); 198 | putInFront(pointer[2]); 199 | putInFront(pointer[3]); 200 | } 201 | 202 | void ByteBuffer::putLong(long in){ 203 | byte *pointer = (byte *)∈ 204 | put(pointer[3]); 205 | put(pointer[2]); 206 | put(pointer[1]); 207 | put(pointer[0]); 208 | } 209 | 210 | 211 | long ByteBuffer::getLong(){ 212 | long ret; 213 | byte *pointer = (byte *)&ret; 214 | pointer[3] = get(); 215 | pointer[2] = get(); 216 | pointer[1] = get(); 217 | pointer[0] = get(); 218 | return ret; 219 | } 220 | 221 | long ByteBuffer::getLongFromBack(){ 222 | long ret; 223 | byte *pointer = (byte *)&ret; 224 | pointer[0] = getFromBack(); 225 | pointer[1] = getFromBack(); 226 | pointer[2] = getFromBack(); 227 | pointer[3] = getFromBack(); 228 | return ret; 229 | } 230 | 231 | 232 | // 233 | // Floats 234 | // 235 | 236 | void ByteBuffer::putFloatInFront(float in){ 237 | byte *pointer = (byte *)∈ 238 | putInFront(pointer[0]); 239 | putInFront(pointer[1]); 240 | putInFront(pointer[2]); 241 | putInFront(pointer[3]); 242 | } 243 | 244 | void ByteBuffer::putFloat(float in){ 245 | byte *pointer = (byte *)∈ 246 | put(pointer[3]); 247 | put(pointer[2]); 248 | put(pointer[1]); 249 | put(pointer[0]); 250 | } 251 | 252 | float ByteBuffer::getFloat(){ 253 | float ret; 254 | byte *pointer = (byte *)&ret; 255 | pointer[3] = get(); 256 | pointer[2] = get(); 257 | pointer[1] = get(); 258 | pointer[0] = get(); 259 | return ret; 260 | } 261 | 262 | float ByteBuffer::getFloatFromBack(){ 263 | float ret; 264 | byte *pointer = (byte *)&ret; 265 | pointer[0] = getFromBack(); 266 | pointer[1] = getFromBack(); 267 | pointer[2] = getFromBack(); 268 | pointer[3] = getFromBack(); 269 | return ret; 270 | } 271 | 272 | 273 | -------------------------------------------------------------------------------- /example/lib/PinChangeInt/Examples/ByteBuffer/ByteBuffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | ByteBuffer.h - A circular buffer implementation for Arduino 3 | Created by Sigurdur Orn, July 19, 2010. siggi@mit.edu 4 | Updated by GreyGnome (aka Mike Schwager) Thu Feb 23 17:25:14 CST 2012 5 | added the putString() method and the fillError variable. 6 | added the checkError() and resetError() methods. The checkError() method resets the fillError variable 7 | to false as a side effect. 8 | added the ByteBuffer(unsigned int buf_size) constructor. 9 | added the init() method, and had the constructor call it automagically. 10 | protected certain sections of the code with cli()/sei() calls, for safe use by interrupts. 11 | Also made the capacity, position, length, and fillError variables volatile, for safe use by interrupts. 12 | */ 13 | 14 | #ifndef ByteBuffer_h 15 | #define ByteBuffer_h 16 | 17 | #if defined(ARDUINO) && ARDUINO >= 100 18 | #include 19 | #else 20 | #include 21 | #endif 22 | //#include 23 | 24 | #define DEFAULTBUFSIZE 32 25 | class ByteBuffer 26 | { 27 | public: 28 | ByteBuffer() { 29 | init(); 30 | }; 31 | ByteBuffer(unsigned int buf_size) { 32 | init(buf_size); 33 | }; 34 | 35 | // This method initializes the datastore of the buffer to a certain size. 36 | void init(unsigned int buf_size); 37 | 38 | // This method initializes the datastore of the buffer to the default size. 39 | void init(); 40 | 41 | // This method resets the buffer into an original state (with no data) 42 | void clear(); 43 | 44 | // This method resets the fillError variable to false. 45 | void resetError(); 46 | 47 | // This method tells you if your buffer overflowed at some time since the last 48 | // check. The error state will be reset to false. 49 | boolean checkError(); 50 | 51 | // This releases resources for this buffer, after this has been called the buffer should NOT be used 52 | void deAllocate(); 53 | 54 | // Returns how much space is used in the buffer 55 | int getSize(); 56 | 57 | // Returns the maximum capacity of the buffer 58 | int getCapacity(); 59 | 60 | // This method returns the byte that is located at index in the buffer but doesn't modify the buffer like the get methods (doesn't remove the retured byte from the buffer) 61 | byte peek(unsigned int index); 62 | 63 | // 64 | // Put methods, either a regular put in back or put in front 65 | // 66 | uint8_t putInFront(byte in); 67 | uint8_t put(byte in); 68 | uint8_t putString(char *in); 69 | 70 | void putIntInFront(int in); 71 | void putInt(int in); 72 | 73 | void putLongInFront(long in); 74 | void putLong(long in); 75 | 76 | void putFloatInFront(float in); 77 | void putFloat(float in); 78 | 79 | // 80 | // Get methods, either a regular get from front or from back 81 | // 82 | byte get(); 83 | byte getFromBack(); 84 | 85 | int getInt(); 86 | int getIntFromBack(); 87 | 88 | long getLong(); 89 | long getLongFromBack(); 90 | 91 | float getFloat(); 92 | float getFloatFromBack(); 93 | 94 | private: 95 | byte* data; 96 | 97 | volatile unsigned int capacity; 98 | volatile unsigned int position; 99 | volatile unsigned int length; 100 | volatile boolean fillError; 101 | }; 102 | 103 | #endif 104 | 105 | -------------------------------------------------------------------------------- /example/lib/PinChangeInt/Examples/GetPSTR/GetPSTR.h: -------------------------------------------------------------------------------- 1 | #ifndef INCLUDE_GETPSTR 2 | #define INCLUDE_GETPSTR 3 | 4 | #if defined(ARDUINO) && ARDUINO >= 100 5 | #include 6 | #else 7 | #include "pins_arduino.h" 8 | #include "WProgram.h" 9 | #include "wiring.h" 10 | #endif 11 | 12 | #define getPSTR(s) pgmStrToRAM(PSTR(s)) 13 | 14 | char *_pstr_to_print; 15 | char *pgmStrToRAM(PROGMEM char *theString) { 16 | free(_pstr_to_print); 17 | _pstr_to_print=(char *) malloc(strlen_P(theString)); 18 | strcpy_P(_pstr_to_print, theString); 19 | return (_pstr_to_print); 20 | } 21 | #endif 22 | -------------------------------------------------------------------------------- /example/lib/PinChangeInt/Examples/PinChangeIntExample/PinChangeIntExample.pde: -------------------------------------------------------------------------------- 1 | // PinChangeIntExample, version 1.1 Sun Jan 15 06:24:19 CST 2012 2 | // See the Wiki at http://code.google.com/p/arduino-pinchangeint/wiki for more information. 3 | //-------- define these in your sketch, if applicable ---------------------------------------------------------- 4 | // You can reduce the memory footprint of this handler by declaring that there will be no pin change interrupts 5 | // on any one or two of the three ports. If only a single port remains, the handler will be declared inline 6 | // reducing the size and latency of the handler. 7 | //#define NO_PORTB_PINCHANGES // to indicate that port b will not be used for pin change interrupts 8 | //#define NO_PORTC_PINCHANGES // to indicate that port c will not be used for pin change interrupts 9 | // #define NO_PORTD_PINCHANGES // to indicate that port d will not be used for pin change interrupts 10 | // if there is only one PCInt vector in use the code can be inlined 11 | // reducing latency and code size 12 | // define DISABLE_PCINT_MULTI_SERVICE below to limit the handler to servicing a single interrupt per invocation. 13 | // #define DISABLE_PCINT_MULTI_SERVICE 14 | //-------- define the above in your sketch, if applicable ------------------------------------------------------ 15 | #include 16 | 17 | // This example demonstrates a configuration of 3 interrupting pins and 2 interrupt functions. 18 | // All interrupts are serviced immediately, but one of the pins (pin 4) will show you immediately 19 | // on the Terminal. The other function connected to 2 pins sets an array member that is queried in loop(). 20 | // You can then query the array at your leisure. 21 | // This makes loop timing non-critical. 22 | 23 | // Add more Pins at your leisure. 24 | // For the Analog Input pins used as digital input pins, and you can use 14, 15, 16, etc. 25 | // or you can use A0, A1, A2, etc. (the Arduino code comes with #define's 26 | // for the Analog Input pins and will properly recognize e.g., pinMode(A0, INPUT); 27 | #define PIN1 2 28 | #define PIN2 3 29 | #define PIN3 4 30 | 31 | uint8_t latest_interrupted_pin; 32 | uint8_t interrupt_count[20]={0}; // 20 possible arduino pins 33 | void quicfunc() { 34 | latest_interrupted_pin=PCintPort::arduinoPin; 35 | interrupt_count[latest_interrupted_pin]++; 36 | }; 37 | 38 | // You can assign any number of functions to any number of pins. 39 | // How cool is that? 40 | void pin3func() { 41 | Serial.print("Pin "); Serial.print(PIN3, DEC); Serial.println("!"); 42 | } 43 | 44 | void setup() { 45 | pinMode(PIN1, INPUT); digitalWrite(PIN1, HIGH); 46 | PCintPort::attachInterrupt(PIN1, &quicfunc, FALLING); // add more attachInterrupt code as required 47 | pinMode(PIN2, INPUT); digitalWrite(PIN2, HIGH); 48 | PCintPort::attachInterrupt(PIN2, &quicfunc, FALLING); 49 | pinMode(PIN3, INPUT); digitalWrite(PIN3, HIGH); 50 | PCintPort::attachInterrupt(PIN3, &pin3func, CHANGE); 51 | Serial.begin(115200); 52 | Serial.println("---------------------------------------"); 53 | } 54 | 55 | uint8_t i; 56 | void loop() { 57 | uint8_t count; 58 | Serial.print("."); 59 | delay(1000); 60 | for (i=0; i < 20; i++) { 61 | if (interrupt_count[i] != 0) { 62 | count=interrupt_count[i]; 63 | interrupt_count[i]=0; 64 | Serial.print("Count for pin "); 65 | if (i < 14) { 66 | Serial.print("D"); 67 | Serial.print(i, DEC); 68 | } else { 69 | Serial.print("A"); 70 | Serial.print(i-14, DEC); 71 | } 72 | Serial.print(" is "); 73 | Serial.println(count, DEC); 74 | } 75 | } 76 | } 77 | 78 | -------------------------------------------------------------------------------- /example/lib/PinChangeInt/Examples/PinChangeIntSpeedTest/PinChangeIntSpeedTest.pde: -------------------------------------------------------------------------------- 1 | // PinChangeIntSpeedTest by GreyGnome aka Mike Schwager. Version numbers here refer to this sketch. 2 | // Version 1.0 - initial version 3 | // Version 1.1 - added code to test digitalRead() 4 | // Version 1.2 - added new comments for the #define's for the NO_PORTx_PINCHANGES. 5 | // Version 1.3 - includes cbiface.h with ooPinChangeInt, rather than cb.h 6 | // Version 1.4 - testing version 2.10Beta with robtillaart's optimization 7 | // Also added a #define/#undef INLINE_PCINTFUNC for inlining of the function called by the interrupt. 8 | // Default: #undef for using the function as per usual. Changed PCIVERSION so that 9 | // ooPinChangeInt starts at 1000 instead of 200. Modified the "Start" message to show "Start..", pause 10 | // for 1 second, show "*\n" (where \n is a newline), pause for 1 second, then run the test. 11 | // Version 1.4 - made this compatible with version 1.5 of PinChangeInt 12 | // Version 1.5 - modified it to use #define OOPCIVERSION for ooPinChangeInt 13 | 14 | // This version number is for ooPinChangeInt 15 | //#define OOPCIVERSION 1030 16 | #ifndef OOPCIVERSION 17 | #define PCIVERSION 217 // 110 if using PinChangeInt-1.1, 120 for version 1.2 18 | // 1000 for ooPinChangeIntversion 1.00, 1001 for ooPinChangeInt version 1.01, etc. 19 | #endif 20 | 21 | //-------- define these in your sketch, if applicable ---------------------------------------------------------- 22 | // You can reduce the memory footprint of this handler by declaring that there will be no pin change interrupts 23 | // on any one or two of the three ports. If only a single port remains, the handler will be declared inline 24 | // reducing the size and latency of the handler. 25 | #undef NO_PORTB_PINCHANGES // to indicate that port b will not be used for pin change interrupts 26 | #undef NO_PORTC_PINCHANGES // to indicate that port c will not be used for pin change interrupts 27 | // #define NO_PORTD_PINCHANGES // to indicate that port d will not be used for pin change interrupts 28 | // You can reduce the code size by 20-50 bytes, and you can speed up the interrupt routine 29 | // slightly by declaring that you don't care if the static variables PCintPort::pinState and/or 30 | // PCintPort::arduinoPin are set and made available to your interrupt routine. 31 | // #define NO_PIN_STATE // to indicate that you don't need the pinState 32 | // #define NO_PIN_NUMBER // to indicate that you don't need the arduinoPin 33 | // if there is only one PCInt vector in use the code can be inlined 34 | // reducing latency and code size 35 | // define DISABLE_PCINT_MULTI_SERVICE below to limit the handler to servicing a single interrupt per invocation. 36 | //#define DISABLE_PCINT_MULTI_SERVICE 37 | //-------- define the above in your sketch, if applicable ------------------------------------------------------ 38 | #if defined(OOPCIVERSION) 39 | #define LIBRARYUNDERTEST "ooPinChangeInt" 40 | #include 41 | #if PCIVERSION == 1001 42 | #include 43 | #else 44 | #include 45 | #endif 46 | #else 47 | #define LIBRARYUNDERTEST "PinChangeInt" 48 | #include 49 | #endif 50 | 51 | #define SERIALSTUFF // undef to take out all serial statements. Default: #define for measuring time. 52 | #undef MEMTEST // undef to take out memory tests. Default: #undef for measuring time. 53 | #undef INLINE_PCINTFUNC // define to inline the function called from the interrupt. This should have no effect, 54 | // because the compiler will store the registers upon calling the interrupt routine, just 55 | // like calling a function. Still, we test all assumptions. 56 | //----------------------- 57 | // NOTE: BECAUSE OF COLLISIONS in these libraries, you CANNOT have both libraries: PinChangeInt 58 | // and ooPinChangeInt in the libraries directory at the same time. That said, under UNIX-y operating 59 | // systems, it's easy to move the library directory to a name such as "PinChangeInt-1.3", which the 60 | // Arduino will not recognize, and then create a symbolic link when you want to use a library. Such as: 61 | // cd ~/Documents/Arduino/libaries 62 | // mv PinChangeInt PinChangeInt-1.30 63 | // mv ooPinChangeInt ooPinChangeInt-1.00 64 | // ln -s PinChangeInt-1.30 PinChangeInt 65 | 66 | #undef FLASH // to flash LED on pin 13 during test 67 | 68 | #ifdef MEMTEST 69 | #include 70 | #endif 71 | 72 | #define TEST 6 73 | 74 | #if TEST == 1 75 | #define PTEST 2 // pin to trigger interrupt. pins 0 and 1 are used 76 | #define PLOW 2 // by Serial, so steer clear of them! 77 | #define PHIGH 2 // Interrupts are attached to these pins 78 | 79 | #elif TEST == 2 // see the #if TEST == 2 || TEST == 3 code, below 80 | #define PTEST 2 81 | #define PLOW 2 82 | #define PHIGH 2 // need to attachInterrupt to 5 in the code 83 | 84 | #elif TEST == 3 // see the #if TEST == 2 || TEST == 3 code, below 85 | #define PTEST 5 86 | #define PLOW 2 87 | #define PHIGH 2 // need to attachInterrupt to 5 in the code 88 | 89 | #elif TEST == 4 90 | #define PTEST 2 91 | #define PLOW 2 92 | #define PHIGH 5 93 | 94 | #elif TEST == 5 95 | #define PTEST 3 96 | #define PLOW 2 97 | #define PHIGH 5 98 | 99 | #elif TEST == 6 100 | #define PTEST 4 101 | #define PLOW 2 102 | #define PHIGH 5 103 | 104 | #elif TEST == 7 105 | #define PTEST 5 106 | #define PLOW 2 107 | #define PHIGH 5 108 | #endif 109 | 110 | uint8_t qf0; 111 | 112 | #ifdef INLINE_PCINTFUNC 113 | #define INLINE_PCINTFUNC inline 114 | #else 115 | #define INLINE_PCINTFUNC 116 | #endif 117 | INLINE_PCINTFUNC void quicfunc(); 118 | void quicfunc() { 119 | qf0=TCNT0; 120 | } 121 | 122 | #if defined(OOPCIVERSION) 123 | class speedy : public CallBackInterface 124 | { 125 | public: 126 | uint8_t id; 127 | static uint8_t var0; 128 | speedy () { id=0; }; 129 | speedy (uint8_t _i): id(_i) {}; 130 | 131 | void cbmethod() { 132 | speedy::var0=TCNT0; 133 | //Serial.print("Speedy method "); // debugging 134 | //Serial.println(id, DEC); 135 | }; 136 | }; 137 | uint8_t speedy::var0=0; 138 | #endif 139 | 140 | volatile uint8_t *led_port; 141 | volatile uint8_t *pinT_OP; 142 | volatile uint8_t *pinT_IP; 143 | uint8_t led_mask, not_led_mask; 144 | uint8_t pinT_M, not_pinT_M; 145 | volatile uint8_t pintest, pinIntLow, pinIntHigh; 146 | uint8_t totalpins; 147 | #if defined(OOPCIVERSION) 148 | speedy speedster[8]={speedy(0), speedy(1), speedy(2), speedy(3), speedy(4), speedy(5), speedy(6), speedy(7) }; 149 | #endif 150 | #ifdef MEMTEST 151 | int freemem; 152 | #endif 153 | 154 | int i=0; 155 | 156 | #define PINLED 13 157 | void setup() 158 | { 159 | #ifdef SERIALSTUFF 160 | Serial.begin(115200); Serial.println("---------------------------------------"); 161 | #endif // SERIALSTUFF 162 | // set up ports for trigger 163 | pinMode(0, OUTPUT); digitalWrite(0, HIGH); 164 | pinMode(1, OUTPUT); digitalWrite(1, HIGH); 165 | pinMode(2, OUTPUT); digitalWrite(2, HIGH); 166 | pinMode(3, OUTPUT); digitalWrite(3, HIGH); 167 | pinMode(4, OUTPUT); digitalWrite(4, HIGH); 168 | pinMode(5, OUTPUT); digitalWrite(5, HIGH); 169 | pinMode(6, OUTPUT); digitalWrite(6, HIGH); 170 | pinMode(7, OUTPUT); digitalWrite(7, HIGH); 171 | #ifdef FLASH 172 | led_port=portOutputRegister(digitalPinToPort(PINLED)); 173 | led_mask=digitalPinToBitMask(PINLED); 174 | not_led_mask=led_mask^0xFF; 175 | pinMode(PINLED, OUTPUT); digitalWrite(PINLED, LOW); 176 | #endif 177 | // ***************************************************************************** 178 | // set up ports for output ************ PIN TO TEST IS GIVEN HERE ************** 179 | // ***************************************************************************** 180 | pintest=PTEST; 181 | pinIntLow=PLOW; pinIntHigh=PHIGH; // Interrupts are attached to these pins 182 | // ***************************************************************************** 183 | // ***************************************************************************** 184 | pinT_OP=portOutputRegister(digitalPinToPort(pintest)); // output port 185 | pinT_IP=portInputRegister(digitalPinToPort(pintest)); // input port 186 | pinT_M=digitalPinToBitMask(pintest); // mask 187 | not_pinT_M=pinT_M^0xFF; // not-mask 188 | *pinT_OP|=pinT_M; 189 | for (i=pinIntLow; i <= pinIntHigh; i++) { 190 | #if defined(OOPCIVERSION) 191 | PCintPort::attachInterrupt(i, &speedster[i], CHANGE); // C++ technique; v1.3 or better 192 | #endif 193 | #if defined(PCIVERSION) 194 | PCintPort::attachInterrupt((uint8_t) i, &quicfunc, CHANGE); // C technique; v1.2 or earlier 195 | #endif 196 | } 197 | #if TEST == 2 || TEST == 3 198 | i=5; totalpins=2; 199 | #if defined(OOPCIVERSION) 200 | PCintPort::attachInterrupt(i, &speedster[i], CHANGE); // C++ technique; v1.3 or better 201 | #endif 202 | #if defined(PCIVERSION) 203 | PCintPort::attachInterrupt(i, &quicfunc, CHANGE); // C technique; v1.2 or earlier 204 | #endif 205 | #else 206 | totalpins=pinIntHigh - pinIntLow + 1; 207 | #endif 208 | i=0; 209 | } // end setup() 210 | 211 | uint8_t k=0; 212 | unsigned long milliStart, milliEnd, elapsed; 213 | void loop() { 214 | k=0; 215 | *pinT_OP|=pinT_M; // pintest to 1 216 | #ifdef SERIALSTUFF 217 | Serial.print(LIBRARYUNDERTEST); Serial.print(" "); 218 | Serial.print("TEST: "); Serial.print(TEST, DEC); Serial.print(" "); 219 | #ifndef MEMTEST 220 | Serial.print("test pin mask: "); Serial.print(pinT_M, HEX); 221 | Serial.print(". Total of "); Serial.print(totalpins, DEC); Serial.println(" pins enabled."); 222 | #endif 223 | #ifdef MEMTEST 224 | freemem=freeMemory(); Serial.print("Free memory: "); Serial.println(freemem, DEC); 225 | #endif 226 | #endif 227 | delay(1000); 228 | Serial.print("Start.."); 229 | delay(1000); Serial.print("*"); 230 | #ifdef FLASH 231 | *led_port|=led_mask; 232 | #endif 233 | milliStart=millis(); 234 | while (k < 10) { 235 | i=0; 236 | while (i < 10000) { 237 | *pinT_OP&=not_pinT_M; // pintest to 0 ****************************** 16.8 us 238 | *pinT_OP|=pinT_M; // pintest to 1 ****************************** ...to get here 239 | i++; 240 | } 241 | k++; 242 | } 243 | milliEnd=millis(); 244 | #ifdef FLASH 245 | *led_port&=not_led_mask; 246 | #endif 247 | elapsed=milliEnd-milliStart; 248 | #ifndef MEMTEST 249 | Serial.print(" Elapsed: "); 250 | Serial.println(elapsed, DEC); 251 | #endif 252 | #ifdef SERIALSTUFF 253 | Serial.print("Interrupted pin: "); 254 | #if defined(OOPCIVERSION) 255 | Serial.println(speedster[pintest].id, DEC); 256 | #else 257 | Serial.println(PCintPort::arduinoPin, DEC); 258 | #endif 259 | #ifdef MEMTEST 260 | freemem=freeMemory(); Serial.print("END-Free memory: "); Serial.println(freemem, DEC); 261 | #endif 262 | #endif 263 | delay(500); 264 | } 265 | 266 | -------------------------------------------------------------------------------- /example/lib/PinChangeInt/Examples/PinChangeIntTest/PinChangeIntTest.pde: -------------------------------------------------------------------------------- 1 | // PinChangeIntTest 2 | // version 1.0 Wed Feb 15 07:25:09 CST 2012 3 | // Version 1.1 Fri Jun 22 19:10:50 CDT 2012 minor tweaks to eliminate compiler warnings. Also, there were bugfixes in ByteBuffer. 4 | // I had some "cli()" without "sei()" in there. 5 | // See the Wiki at http://code.google.com/p/arduino-pinchangeint/wiki for more information. 6 | // This sketch requires the ByteBuffer library, which is found in the PinChangeInt zipfile. 7 | //-------- define these in your sketch, if applicable ---------------------------------------------------------- 8 | //-------- This must go ahead of the #include statement -------------------------------------------------------- 9 | // You can reduce the memory footprint of this handler by declaring that there will be no pin change interrupts 10 | // on any one or two of the three ports. If only a single port remains, the handler will be declared inline 11 | // reducing the size and latency of the handler. 12 | // #define NO_PORTB_PINCHANGES // to indicate that port b will not be used for pin change interrupts 13 | // #define NO_PORTC_PINCHANGES // to indicate that port c will not be used for pin change interrupts 14 | // #define NO_PORTD_PINCHANGES // to indicate that port d will not be used for pin change interrupts 15 | // You can reduce the code size by 20-50 bytes, and you can speed up the interrupt routine 16 | // slightly by declaring that you don't care if the static variables PCintPort::pinState and/or 17 | // PCintPort::arduinoPin are set and made available to your interrupt routine. 18 | // #define NO_PIN_STATE // to indicate that you don't need the pinState 19 | // #define NO_PIN_NUMBER // to indicate that you don't need the arduinoPin 20 | // if there is only one PCInt vector in use the code can be inlined 21 | // reducing latency and code size 22 | // define DISABLE_PCINT_MULTI_SERVICE below to limit the handler to servicing a single interrupt per invocation. 23 | // #define DISABLE_PCINT_MULTI_SERVICE 24 | // The following is intended for testing purposes. If defined, then a variable PCintPort::pinMode can be read 25 | // in your interrupt subroutine. It is not defined by default: 26 | // #define PINMODE 27 | //-------- define the above in your sketch, if applicable ------------------------------------------------------ 28 | #define PINMODE 29 | #define FLASH 30 | #include 31 | #include 32 | 33 | // This example demonstrates a configuration of 6 interrupting pins and 3 interrupt functions. 34 | // A variety of interrupting pins have been chosen, so as to test all PORTs on the Arduino. 35 | // The pins are as follows: 36 | #define tPIN1 2 // port D 37 | #define tPIN2 3 38 | #define tPIN3 11 // Port B 39 | #define tPIN4 12 40 | #define tPIN5 A3 // Port C, also can be given as "17" 41 | #define tPIN6 A4 // starts and stops the count 42 | // All pins send interrupts. Arduino pins 2 and A4 (tPIN1,6) interrupt on FALLING. 43 | // Arduino pins 3 and 12 (tPIN2,4) interrupt on RISING. 44 | // Arduino pins 11 and A3 (tPIN5) interrupts on CHANGE. 45 | // quicfunc0 is attached to Arduino pins 2, 3, 11, and 12 (tPIN1-4) 46 | // quicfunc1 is attached to Arduino pin A3 (tPIN5) 47 | // quicfunc2 is attached to Arduino pin A4 (tPIN6). 48 | // NOTE: 49 | // For the Analog Input pins used as digital input pins, you can use numbers such as 14, 15, 16, etc. 50 | // or you can use A0, A1, A2, etc. (the Arduino code comes with #define's for the Analog Input pin 51 | // names and will properly recognize e.g., pinMode(A0, INPUT)); 52 | 53 | // HOW IT WORKS 54 | // The interrupt on Arduino pin A4 (tPIN6) will, when triggered, start the counting of interrupts. 55 | // The array interrupt_count0[20] is updated in the interrupts; each cell keeps track of the number 56 | // of interrupts on one of the 20 available interrupt pins on the Arduino. Every second in the main 57 | // loop the array is scanned and registered interrupts are reported for all pins interrupted since 58 | // the previous second. If no interrupts, the output is quiet. 59 | 60 | // tPIN6 is special. Not only does it start the counting of the interrups, but it turns on and off 61 | // interrupts on pins 2, 11, and A3/17 (tPIN1, tPIN3, tPIN5). All pins start by interrupting, but after 62 | // the count is turned on and then turned off, the 3 pins are detached from interrupts. 63 | // Everytime thereafter when the count is turned off the 3 pins are detached. They are reattached 64 | // when turned on. 65 | 66 | // Output is copied to a buffer, because we can't do a Serial.print() statement in an interrupt 67 | // routine. The main loop checks for entries in the buffer and prints them if found. 68 | // Output looks like this: 69 | // -F- - an interrupt triggered by a falling signal occurred. 70 | // +R+ - an interrupt triggered by a rising signal occurred. 71 | // *C* - an interrupt triggered by a change in signal occurred. 72 | // f#p#-P# - f# shows the interrupt subroutine that was called: 0, 1, or 2 73 | // - p# shows the pin number that triggered the interrupt 74 | // - P# shows the port that this pin number is attached to. 2 is PORTB, 3 is PORTC, 4 is PORTD 75 | 76 | // HOW TO CONNECT 77 | // Each pin gets a momentary contact switch connected to it. One side of the switch should connect 78 | // to ground. The other side of the switch connects to the Arduino pin. For my purposes, I am using 79 | // two rotary encoders. Each encoder contains 3 switches. But 6 regular pushbuttons would work, too. 80 | 81 | /* WHAT TO LOOK FOR 82 | Output is sent to the serial line, so the Arduino IDE's serial terminal should be opened. 83 | Upon startup, press tPINS1-5. You will see output like this: 84 | -F-f0p2-P4 (counting off) 85 | ..*C*f0p11-P2 (counting off) 86 | +R+f0p3-P4 (counting off) 87 | This shows that 88 | 1. an interrupt was triggered on a falling signal (*F*). It called (f0) function 0, which is quicfunc0. 89 | The triggering pin was (p2) Arduuino pin 2, which is on (P4) Port 4 (PORTD). Counting of this interrupt is 90 | off, so you will not see any output from the main loop. 91 | 2. Two dots appeared. Dots came from iterations of loop(), so these 2 dots show that the two interrupts happened 2 seconds apart. 92 | 3. an interrupt was triggered on a change in signal (*C*). It called quicfunc0, from Arduino pin 11, on Port 2 (PORTB). 93 | The interrupt was not counted. 94 | 4. an interrupt was triggered on a rising signal (+R+). It called quicfunc0, from Arduino pin 3, on Purt 4 (PORTD). 95 | The pin should have started out at the high level, so likely the signal fell during onother interrupt, and now 96 | the rise has been caught. 97 | 98 | Now press the button attached to tPIN6 (in our case, A4 or D18). You will see something like this: 99 | -F-START! f2p18-P3 100 | .Count for pin A4 is 1 101 | This shows that 102 | 1. The counting machanism (START!) was triggered by a folling signal (-F-) on pin 18 (p18) which is in Port 3 (P3) (which == PORTC) and 103 | function f2 was called (f2). 104 | 2. A dot appeared, which came from loop() because a second passed. 105 | 3. The count for p18 or A4 was displayed. 106 | 107 | Now you will see messages for all the pins that you manipulate, for example: 108 | *C*f0p11-P2 109 | +R+f0p3-P4 110 | *C*f0p11-P2 111 | +R+f0p3-P4 112 | *C*f0p11-P2 113 | .Count for pin D3 is 6 114 | Count for pin D11 is 9 115 | .+R+f0p3-P4 116 | -F-f0p2-P4 117 | .Count for pin D2 is 1 118 | Count for pin D3 is 1 119 | These codes reflect the interrupts, as described above. This output will take place until you press tPIN6: 120 | -F-f2: STOP! Counting off. 121 | Interrupt OFF on tPIN1 (2) tPIN3 (11) tPIN5 (17) 122 | Then you will see output like this: 123 | .....................+R+f0p12-P2 (counting off) 124 | .+R+f0p12-P2 (counting off) 125 | +R+f0p12-P2 (counting off) 126 | +R+f0p12-P2 (counting off) 127 | and tPIN1, tPIN3, and tPIN5 will not trigger interrupts. 128 | */ 129 | // NOTES 130 | // Output overwrites: 131 | // It's possible during moderately fast interrupts to see your print output get garbled; eg, 132 | // +R+f0p12-P2 (+R+f0p12-P2 (counting +R+f0p12-P2 (cou+R+f0p12-P+R+f0p12 133 | // This is because the print of the buffer takes place inside a while loop, and it can 134 | // be interrupted and new data inserted into the buffer at a midpoint of the buffer's text. 135 | // Just by spinning my rotary encoders I can readily generate over 200 interrupts per second 136 | // on a pin, which is easily fast enough to overrun Serial output at 115,200 bps. 137 | // The lesson here? ...Interrupts are tricky, and interrupt service routines should be fast. 138 | // Just sayin'. 139 | 140 | // Pins: 141 | // We want to use pins from each of ports B, C and D. So choose wisely. Ports are shown in 142 | // this diagram of the ATmega328P chip. PD0 means "Port D, pin 0". PC3 means "Port C, Pin 3", 143 | // PB2 means "Port B, pin 2" and so on. The corresponding Arduino pins are in parentheses. 144 | // So PB2 is Arduino pin D 10, for example. 145 | /* 146 | +-\/-+ 147 | PC6 1| |28 PC5 (AI 5) 148 | (D 0) PD0 2| |27 PC4 (AI 4) 149 | (D 1) PD1 3| |26 PC3 (AI 3) 150 | (D 2) PD2 4| |25 PC2 (AI 2) 151 | PWM+ (D 3) PD3 5| |24 PC1 (AI 1) 152 | (D 4) PD4 6| |23 PC0 (AI 0) 153 | VCC 7| |22 GND 154 | GND 8| |21 AREF 155 | PB6 9| |20 AVCC 156 | PB7 10| |19 PB5 (D 13) 157 | PWM+ (D 5) PD5 11| |18 PB4 (D 12) 158 | PWM+ (D 6) PD6 12| |17 PB3 (D 11) PWM 159 | (D 7) PD7 13| |16 PB2 (D 10) PWM 160 | (D 8) PB0 14| |15 PB1 (D 9) PWM 161 | +----+ 162 | */ 163 | 164 | uint8_t pins[6]={ tPIN1, tPIN2, tPIN3, tPIN4, tPIN5, tPIN6 }; 165 | uint8_t ports[6]={ 0, 0, 0, 0, 0, 0 }; 166 | 167 | uint8_t latest_interrupted_pin; 168 | uint8_t interrupt_count[20]={0}; // 20 possible arduino pins 169 | uint8_t port; 170 | uint8_t mode; 171 | 172 | ByteBuffer printBuffer(80); 173 | char charArray[16]; 174 | char numBuffer[4] = { 0, 0, 0, 0 }; 175 | uint8_t printFull=0; 176 | 177 | volatile boolean start=0; 178 | volatile boolean initial=true; 179 | long begintime=0; 180 | long now=0; 181 | 182 | void uint8ToString(char *outString, uint8_t number) { 183 | uint8_t hundreds=0; 184 | uint8_t tens=0; 185 | uint8_t ones=0; 186 | 187 | while (number >= 100 ) { 188 | hundreds++; 189 | number-=100; 190 | } 191 | while (number >= 10 ) { 192 | tens++; 193 | number-=10; 194 | } 195 | ones=number; 196 | ones+=48; 197 | if (hundreds > 0) { hundreds+=48; tens+=48; outString[0]=hundreds; outString[1]=tens; outString[2]=ones; outString[3]=0; } 198 | else if (tens > 0) { tens+=48; outString[0]=tens; outString[1]=ones; outString[2]=0; } 199 | else { outString[0]=ones; outString[1]=0; }; 200 | } 201 | 202 | void showMode() { 203 | switch (mode) { 204 | case FALLING: 205 | printBuffer.putString((char *) "-F-"); 206 | break; 207 | case RISING: 208 | printBuffer.putString((char *) "+R+"); 209 | break; 210 | case CHANGE: 211 | printBuffer.putString((char *) "*C*"); 212 | break; 213 | } 214 | } 215 | 216 | void quicfunc0() { 217 | latest_interrupted_pin=PCintPort::arduinoPin; 218 | mode=PCintPort::pinmode; 219 | showMode(); 220 | if (start==1) { 221 | interrupt_count[latest_interrupted_pin]++; 222 | } 223 | uint8ToString(numBuffer, latest_interrupted_pin); 224 | printBuffer.putString((char *) "f0p"); printBuffer.putString(numBuffer); printBuffer.putString((char *) "-P"); 225 | uint8ToString(numBuffer, digitalPinToPort(latest_interrupted_pin)); 226 | printBuffer.putString(numBuffer); 227 | if (start !=1) printBuffer.putString((char *) " (counting off)"); 228 | printBuffer.putString((char *) "\n"); 229 | }; 230 | 231 | void quicfunc1() { 232 | latest_interrupted_pin=PCintPort::arduinoPin; 233 | mode=PCintPort::pinmode; 234 | showMode(); 235 | if (start==1) { 236 | interrupt_count[latest_interrupted_pin]++; 237 | } 238 | uint8ToString(numBuffer, latest_interrupted_pin); 239 | printBuffer.putString((char *) "f1p"); printBuffer.putString(numBuffer); printBuffer.putString((char *) "-P"); 240 | uint8ToString(numBuffer, digitalPinToPort(latest_interrupted_pin)); 241 | printBuffer.putString(numBuffer); 242 | if (start !=1) printBuffer.putString((char *) " (counting off)"); 243 | printBuffer.putString((char *) "\n"); 244 | }; 245 | 246 | void quicfunc2() { 247 | latest_interrupted_pin=PCintPort::arduinoPin; 248 | mode=PCintPort::pinmode; 249 | showMode(); 250 | if (start == 1) { 251 | printBuffer.putString((char *) "f2: STOP! Counting off.\n"); 252 | printBuffer.putString((char *) "Interrupt OFF on tPIN1 ("); uint8ToString(numBuffer, tPIN1), printBuffer.putString(numBuffer); 253 | printBuffer.putString((char *) ") tPIN3 (");uint8ToString(numBuffer, tPIN3), printBuffer.putString(numBuffer); 254 | printBuffer.putString((char *) ") tPIN5 (");uint8ToString(numBuffer, tPIN5), printBuffer.putString(numBuffer); 255 | printBuffer.putString((char *) ")\n"); 256 | PCintPort::detachInterrupt(tPIN1); PCintPort::detachInterrupt(tPIN3); PCintPort::detachInterrupt(tPIN5); 257 | start=0; 258 | } else { 259 | start=1; 260 | interrupt_count[latest_interrupted_pin]++; 261 | printBuffer.putString((char *) "START! f2p"); 262 | uint8ToString(numBuffer, latest_interrupted_pin); 263 | printBuffer.putString(numBuffer); printBuffer.putString((char *) "-P"); 264 | uint8ToString(numBuffer, digitalPinToPort(latest_interrupted_pin)); 265 | printBuffer.putString(numBuffer); printBuffer.putString((char *) "\n"); 266 | if (! initial) { 267 | PCintPort::attachInterrupt(tPIN1, &quicfunc0, FALLING); 268 | PCintPort::attachInterrupt(tPIN3, &quicfunc0, CHANGE); 269 | PCintPort::attachInterrupt(tPIN5, &quicfunc1, CHANGE); 270 | } else { 271 | initial=false; 272 | } 273 | } 274 | }; 275 | 276 | uint8_t i; 277 | void setup() { 278 | Serial.begin(115200); 279 | delay(250); 280 | Serial.println("Test"); 281 | delay(500); 282 | for (i=0; i < 7; i++) { 283 | pinMode(pins[i], INPUT); digitalWrite(pins[i], HIGH); 284 | ports[i]=digitalPinToPort(pins[i]); 285 | switch (pins[i]) { 286 | case tPIN1: 287 | PCintPort::attachInterrupt(pins[i], &quicfunc0, FALLING); 288 | break; 289 | case tPIN3: 290 | PCintPort::attachInterrupt(pins[i], &quicfunc0, CHANGE); 291 | break; 292 | case tPIN2: 293 | case tPIN4: 294 | PCintPort::attachInterrupt(pins[i], &quicfunc0, RISING); 295 | break; 296 | case tPIN5: 297 | PCintPort::attachInterrupt(pins[i], &quicfunc1, CHANGE); 298 | break; 299 | case tPIN6: 300 | PCintPort::attachInterrupt(pins[i], &quicfunc2, FALLING); 301 | break; 302 | } 303 | } 304 | //Serial.println(printBuffer.getCapacity(), DEC); 305 | //Serial.println("*---------------------------------------*"); 306 | Serial.print("*---*"); 307 | delay(250); 308 | begintime=millis(); 309 | } 310 | 311 | void loop() { 312 | now=millis(); 313 | uint8_t count; 314 | char outChar; 315 | // uint8_t bufsize; 316 | //if (printBuffer.getSize() != 0) { Serial.print("SZ:"); Serial.println (printBuffer.getSize(), DEC); }; 317 | //bufsize=printBuffer.getSize(); 318 | //if (bufsize > 0) { Serial.print("S:"); Serial.println(bufsize); } 319 | while ((outChar=(char)printBuffer.get()) != 0) Serial.print(outChar); 320 | if ((now - begintime) > 1000) { 321 | Serial.print("."); 322 | if (printBuffer.checkError()) { 323 | Serial.println("NOTICE: Some output lost due to filled buffer."); 324 | } 325 | for (i=0; i < 20; i++) { 326 | if (interrupt_count[i] != 0) { 327 | count=interrupt_count[i]; 328 | interrupt_count[i]=0; 329 | Serial.print("Count for pin "); 330 | if (i < 14) { 331 | Serial.print("D"); 332 | Serial.print(i, DEC); 333 | } else { 334 | Serial.print("A"); 335 | Serial.print(i-14, DEC); 336 | } 337 | Serial.print(" is "); 338 | Serial.println(count, DEC); 339 | } 340 | } 341 | begintime=millis(); 342 | } 343 | } 344 | 345 | -------------------------------------------------------------------------------- /example/lib/PinChangeInt/Examples/PinChangeIntTest2/PinChangeIntTest2.ino: -------------------------------------------------------------------------------- 1 | //#define DISABLE_PCINT_MULTI_SERVICE 2 | #define PINMODE 3 | #define FLASH 4 | #include 5 | #include 6 | #include 7 | 8 | // This example demonstrates a configuration of 6 interrupting pins and 3 interrupt functions. 9 | // A variety of interrupting pins have been chosen, so as to test all PORTs on the Arduino. 10 | // The pins are as follows: 11 | #define tPIN1 2 // port D 12 | #define tPIN2 3 13 | #define tPIN3 11 // Port B 14 | #define tPIN4 12 15 | #define tPIN5 A3 // Port C, also can be given as "17" 16 | #define tPIN6 A4 // starts and stops the count 17 | 18 | uint8_t pins[6]={ tPIN1, tPIN2, tPIN3, tPIN4, tPIN5, tPIN6 }; 19 | uint8_t ports[6]={ 0, 0, 0, 0, 0, 0 }; 20 | 21 | uint8_t latest_interrupted_pin; 22 | uint8_t interrupt_count[20]={0}; // 20 possible arduino pins 23 | uint8_t port; 24 | uint8_t mode; 25 | 26 | ByteBuffer printBuffer(200); 27 | char charArray[16]; 28 | char numBuffer[5] = { 0, 0, 0, 0, 0 }; 29 | uint8_t printFull=0; 30 | 31 | volatile boolean start=0; 32 | volatile boolean initial=true; 33 | long begintime=0; 34 | long now=0; 35 | 36 | void uint8ToHexString(char *outString, uint8_t theByte) { 37 | outString[0]='0'; outString[1]='x'; 38 | uint8_t hinybble=theByte>>4; 39 | uint8_t lonybble=theByte & 0x0F; 40 | if (hinybble < 0x0a) outString[2]=hinybble+48; 41 | else outString[2]=hinybble+55; 42 | if (lonybble < 0x0a) outString[3]=lonybble+48; 43 | else outString[3]=lonybble+55; 44 | outString[4]=0; 45 | } 46 | 47 | void uint8ToString(char *outString, uint8_t number) { 48 | uint8_t hundreds=0; 49 | uint8_t tens=0; 50 | uint8_t ones=0; 51 | 52 | while (number >= 100 ) { 53 | hundreds++; 54 | number-=100; 55 | } 56 | while (number >= 10 ) { 57 | tens++; 58 | number-=10; 59 | } 60 | ones=number; 61 | ones+=48; 62 | if (hundreds > 0) { hundreds+=48; tens+=48; outString[0]=hundreds; outString[1]=tens; outString[2]=ones; outString[3]=0; } 63 | else if (tens > 0) { tens+=48; outString[0]=tens; outString[1]=ones; outString[2]=0; } 64 | else { outString[0]=ones; outString[1]=0; }; 65 | } 66 | 67 | void showMode() { 68 | switch (mode) { 69 | case FALLING: 70 | printBuffer.putString(getPSTR("-F-")); 71 | break; 72 | case RISING: 73 | printBuffer.putString(getPSTR("+R+")); 74 | break; 75 | case CHANGE: 76 | printBuffer.putString(getPSTR("*C*")); 77 | break; 78 | } 79 | } 80 | 81 | /* 82 | void quicfunc0() { 83 | latest_interrupted_pin=PCintPort::arduinoPin; 84 | mode=PCintPort::pinmode; 85 | showMode(); 86 | if (start==1) { 87 | interrupt_count[latest_interrupted_pin]++; 88 | } 89 | uint8ToString(numBuffer, latest_interrupted_pin); 90 | printBuffer.putString((char *) "f0p"); printBuffer.putString(numBuffer); printBuffer.putString((char *) "-P"); 91 | uint8ToString(numBuffer, digitalPinToPort(latest_interrupted_pin)); 92 | printBuffer.putString(numBuffer); 93 | if (start !=1) printBuffer.putString(getPSTR(" no count")); 94 | printBuffer.putString((char *) "\n"); 95 | }; 96 | 97 | void quicfunc1() { 98 | latest_interrupted_pin=PCintPort::arduinoPin; 99 | mode=PCintPort::pinmode; 100 | showMode(); 101 | if (start==1) { 102 | interrupt_count[latest_interrupted_pin]++; 103 | } 104 | uint8ToString(numBuffer, latest_interrupted_pin); 105 | printBuffer.putString(getPSTR("f1p")); printBuffer.putString(numBuffer); printBuffer.putString((char *) "-P"); 106 | uint8ToString(numBuffer, digitalPinToPort(latest_interrupted_pin)); 107 | printBuffer.putString(numBuffer); 108 | if (start !=1) printBuffer.putString(getPSTR(" (counting off)")); 109 | printBuffer.putString((char *) "\n"); 110 | }; 111 | */ 112 | 113 | void quicfunc2() { 114 | //*led_port|=led_mask; 115 | //*led_port&=not_led_mask; // 2 micros to here (ie, 2 micros used to push registers and call subroutine) 116 | latest_interrupted_pin=PCintPort::arduinoPin; 117 | mode=PCintPort::pinmode; 118 | showMode(); 119 | *led_port|=led_mask; // 73 micros to get here from above. Used in "Rigol Timing Example" 120 | *led_port&=not_led_mask; 121 | //uint8ToString(numBuffer, PCintPort::s_count); printBuffer.putString(numBuffer); 122 | *led_port|=led_mask; // 73 micros to get here from above. Second pulse in "Rigol Timing Example" 123 | *led_port&=not_led_mask; 124 | printBuffer.putString(getPSTR(" f2: P"));/* 125 | uint8ToHexString(numBuffer, *portInputRegister(3)); printBuffer.putString(numBuffer);// C port 126 | printBuffer.putString(getPSTR(" pin:")); uint8ToString(numBuffer, latest_interrupted_pin); printBuffer.putString(numBuffer); 127 | printBuffer.putString(getPSTR(" c")); uint8ToHexString(numBuffer, PCintPort::curr); printBuffer.putString(numBuffer); 128 | printBuffer.putString(getPSTR(" l")); uint8ToHexString(numBuffer, PCintPort::s_lastPinView); printBuffer.putString(numBuffer); 129 | printBuffer.putString(getPSTR(" r")); uint8ToHexString(numBuffer, PCintPort::s_portRisingPins); printBuffer.putString(numBuffer); 130 | printBuffer.putString(getPSTR(" f")); uint8ToHexString(numBuffer, PCintPort::s_portFallingPins); printBuffer.putString(numBuffer); 131 | printBuffer.putString(getPSTR(" m")); uint8ToHexString(numBuffer, PCintPort::s_pmask); printBuffer.putString(numBuffer); 132 | printBuffer.putString(getPSTR(" P")); printBuffer.put(PCintPort::s_PORT); printBuffer.putString("\r\n"); 133 | printBuffer.putString(getPSTR("cp")); uint8ToHexString(numBuffer, PCintPort::s_changedPins); printBuffer.putString(numBuffer); 134 | printBuffer.putString(getPSTR(" cXORlpv")); uint8ToHexString(numBuffer, PCintPort::s_currXORlastPinView); printBuffer.putString(numBuffer); 135 | printBuffer.putString(getPSTR(" rp_nCurr")); uint8ToHexString(numBuffer, PCintPort::s_portRisingPins_nCurr); printBuffer.putString(numBuffer); 136 | printBuffer.putString(getPSTR(" fp_nNCurr")); uint8ToHexString(numBuffer, PCintPort::s_portFallingPins_nNCurr); printBuffer.putString(numBuffer); 137 | */printBuffer.putString("\r\n"); 138 | if (PCintPort::pcint_multi > 0) { 139 | printBuffer.putString("MULTI!\n"); PCintPort::pcint_multi=0; 140 | } 141 | if (PCintPort::PCIFRbug > 0) { printBuffer.putString("ERROR: BUG- PCIFR should be reset!"); PCintPort::PCIFRbug=0; } 142 | //s_registers, if it existed, could be used to keep a running queue of the latest interrupts that have 143 | //been serviced by the PCint(). But generally I don't think it's necessary for debugging at this point (famous last words?) 144 | /*if (PCintPort::s_count > 2) { 145 | for (uint8_t i=0; i < PCintPort::s_count; i++) { 146 | uint8ToHexString(numBuffer, PCintPort::s_registers[i]); printBuffer.putString(numBuffer); printBuffer.putString(" "); 147 | } 148 | } 149 | PCintPort::s_count=0;*/ 150 | /* 151 | if (start == 1) { 152 | printBuffer.putString(getPSTR("STOP Count off\n")); 153 | printBuffer.putString(getPSTR("Intr OFF: (")); uint8ToString(numBuffer, tPIN1), printBuffer.putString(numBuffer); 154 | printBuffer.putString((char *) " "); uint8ToString(numBuffer, tPIN3), printBuffer.putString(numBuffer); 155 | printBuffer.putString((char *) " "); uint8ToString(numBuffer, tPIN5), printBuffer.putString(numBuffer); 156 | printBuffer.putString((char *) ")\n"); 157 | PCintPort::detachInterrupt(tPIN1); PCintPort::detachInterrupt(tPIN3); PCintPort::detachInterrupt(tPIN5); 158 | start=0; 159 | } else { 160 | start=1; 161 | interrupt_count[latest_interrupted_pin]++; 162 | printBuffer.putString(getPSTR("START! p")); 163 | uint8ToString(numBuffer, latest_interrupted_pin); 164 | printBuffer.putString(numBuffer); printBuffer.putString((char *) "-P"); 165 | // MIKE put the REAL PORT HERE 166 | uint8ToString(numBuffer, digitalPinToPort(latest_interrupted_pin)); 167 | printBuffer.putString(numBuffer); printBuffer.putString((char *) "\n"); 168 | if (! initial) { 169 | PCintPort::attachInterrupt(tPIN1, &quicfunc0, FALLING); 170 | PCintPort::attachInterrupt(tPIN3, &quicfunc0, CHANGE); 171 | PCintPort::attachInterrupt(tPIN5, &quicfunc1, CHANGE); 172 | } else { 173 | initial=false; 174 | } 175 | }*/ 176 | }; 177 | 178 | uint8_t i; 179 | char hexBuffer[5]; 180 | void setup() { 181 | int8_t returncode=1; 182 | Serial.begin(115200); 183 | Serial.println("Test"); 184 | delay(500); 185 | for (i=5; i < 6; i++) { 186 | pinMode(pins[i], INPUT); digitalWrite(pins[i], HIGH); 187 | ports[i]=digitalPinToPort(pins[i]); 188 | switch (pins[i]) { 189 | /*case tPIN1: 190 | #if PCINT_VERSION > 2100 191 | returncode=PCintPort::attachInterrupt(pins[i], &quicfunc0, FALLING); 192 | #else 193 | PCintPort::attachInterrupt(pins[i], &quicfunc0, FALLING); 194 | #endif 195 | Serial.println(getPSTR("FIRST FAILURE OK.")); 196 | break; 197 | case tPIN3: 198 | #if PCINT_VERSION > 2100 199 | returncode=PCintPort::attachInterrupt(pins[i], &quicfunc0, CHANGE); 200 | #else 201 | PCintPort::attachInterrupt(pins[i], &quicfunc0, CHANGE); 202 | #endif 203 | break; 204 | case tPIN2: 205 | case tPIN4: 206 | #if PCINT_VERSION > 2100 207 | returncode=PCintPort::attachInterrupt(pins[i], &quicfunc0, RISING); 208 | #else 209 | PCintPort::attachInterrupt(pins[i], &quicfunc0, RISING); 210 | #endif 211 | break; 212 | case tPIN5: 213 | #if PCINT_VERSION > 2100 214 | returncode=PCintPort::attachInterrupt(pins[i], &quicfunc1, CHANGE); 215 | #else 216 | PCintPort::attachInterrupt(pins[i], &quicfunc1, CHANGE); 217 | #endif 218 | break;*/ 219 | case tPIN6: 220 | #if PCINT_VERSION > 2100 221 | returncode=PCintPort::attachInterrupt(pins[i], &quicfunc2, FALLING); 222 | #else 223 | PCintPort::attachInterrupt(pins[i], &quicfunc2, FALLING); 224 | #endif 225 | break; 226 | } 227 | #if PCINT_VERSION > 2100 228 | Serial.print(getPSTR("setup(): Interrupt attach ")); 229 | if (returncode != 1) Serial.print(getPSTR("unsuccessful ")); 230 | else Serial.print(getPSTR("GOOD ")); 231 | Serial.print(pins[i], DEC); 232 | Serial.print(getPSTR(":pin, code: ")); Serial.println(returncode, DEC); 233 | #endif 234 | } 235 | //Serial.println(printBuffer.getCapacity(), DEC); 236 | //Serial.println("*---------------------------------------*"); 237 | Serial.print("*---*"); 238 | delay(250); 239 | begintime=millis(); 240 | } 241 | 242 | void loop() { 243 | now=millis(); 244 | uint8_t count; 245 | char outChar; 246 | // uint8_t bufsize; 247 | //if (printBuffer.getSize() != 0) { Serial.print("SZ:"); Serial.println (printBuffer.getSize(), DEC); }; 248 | //bufsize=printBuffer.getSize(); 249 | //if (bufsize > 0) { Serial.print("S:"); Serial.println(bufsize); } 250 | while ((outChar=(char)printBuffer.get()) != 0) Serial.print(outChar); 251 | if ((now - begintime) > 1000) { 252 | Serial.print("."); 253 | if (printBuffer.checkError()) { 254 | Serial.println(getPSTR("!Some output lost due to full buffer!")); 255 | } 256 | for (i=0; i < 20; i++) { 257 | if (interrupt_count[i] != 0) { 258 | count=interrupt_count[i]; 259 | interrupt_count[i]=0; 260 | Serial.print(getPSTR("Count for pin ")); 261 | if (i < 14) { 262 | Serial.print("D"); 263 | Serial.print(i, DEC); 264 | } else { 265 | Serial.print("A"); 266 | Serial.print(i-14, DEC); 267 | } 268 | Serial.print(" is "); 269 | Serial.println(count, DEC); 270 | } 271 | } 272 | begintime=millis(); 273 | } 274 | } 275 | 276 | -------------------------------------------------------------------------------- /example/lib/PinChangeInt/PinChangeInt.h: -------------------------------------------------------------------------------- 1 | // We use 4-character tabstops, so IN VIM: :set ts=4 and :set sw=4 2 | // ...that's: ESCAPE key, colon key, then "s-e-t SPACE key t-s-=-4" 3 | // 4 | /* 5 | * This is the PinChangeInt library for the Arduino. 6 | 7 | See google code project for latest, bugs and info http://code.google.com/p/arduino-pinchangeint/ 8 | For more information Refer to avr-gcc header files, arduino source and atmega datasheet. 9 | 10 | This library was inspired by and derived from "johnboiles" (it seems) 11 | PCInt Arduino Playground example here: http://www.arduino.cc/playground/Main/PcInt 12 | If you are the original author, please let us know at the google code page 13 | 14 | It provides an extension to the interrupt support for arduino by 15 | adding pin change interrupts, giving a way for users to have 16 | interrupts drive off of any pin. 17 | 18 | This program is free software: you can redistribute it and/or modify 19 | it under the terms of the GNU General Public License as published by 20 | the Free Software Foundation, either version 3 of the License, or 21 | (at your option) any later version. 22 | 23 | This program is distributed in the hope that it will be useful, 24 | but WITHOUT ANY WARRANTY; without even the implied warranty of 25 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 26 | GNU General Public License for more details. 27 | 28 | You should have received a copy of the GNU General Public License 29 | along with this program. If not, see . 30 | (the file gpl.txt is included with the library's zip package) 31 | */ 32 | //-------- define these in your sketch, if applicable ---------------------------------------------------------- 33 | //-------- These must go in your sketch ahead of the #include statement ----------------------- 34 | // You can reduce the memory footprint of this handler by declaring that there will be no pin change interrupts 35 | // on any one or two of the three ports. If only a single port remains, the handler will be declared inline 36 | // reducing the size and latency of the handler. 37 | // #define NO_PORTB_PINCHANGES // to indicate that port b will not be used for pin change interrupts 38 | // #define NO_PORTC_PINCHANGES // to indicate that port c will not be used for pin change interrupts 39 | // #define NO_PORTD_PINCHANGES // to indicate that port d will not be used for pin change interrupts 40 | // --- Mega support --- 41 | // #define NO_PORTB_PINCHANGES // to indicate that port b will not be used for pin change interrupts 42 | // #define NO_PORTJ_PINCHANGES // to indicate that port c will not be used for pin change interrupts 43 | // #define NO_PORTK_PINCHANGES // to indicate that port d will not be used for pin change interrupts 44 | // In the Mega, there is no Port C, no Port D. Instead, you get Port J and Port K. Port B remains. 45 | // Port J, however, is practically useless because there is only 1 pin available for interrupts. Most 46 | // of the Port J pins are not even connected to a header connection. // "Mega Support" notes 47 | // --- Sanguino, Mioduino support --- 48 | // #define NO_PORTA_PINCHANGES // to indicate that port a will not be used for pin change interrupts 49 | // -------------------- 50 | // 51 | // Other preprocessor directives... 52 | // You can reduce the code size by 20-50 bytes, and you can speed up the interrupt routine 53 | // slightly by declaring that you don't care if the static variables PCintPort::pinState and/or 54 | // PCintPort::arduinoPin are set and made available to your interrupt routine. 55 | // #define NO_PIN_STATE // to indicate that you don't need the pinState 56 | // #define NO_PIN_NUMBER // to indicate that you don't need the arduinoPin 57 | // #define DISABLE_PCINT_MULTI_SERVICE // to limit the handler to servicing a single interrupt per invocation. 58 | // #define GET_PCINT_VERSION // to enable the uint16_t getPCIintVersion () function. 59 | // The following is intended for testing purposes. If defined, then a whole host of static variables can be read 60 | // in your interrupt subroutine. It is not defined by default, and you DO NOT want to define this in 61 | // Production code!: 62 | // #define PINMODE 63 | //-------- define the above in your sketch, if applicable ------------------------------------------------------ 64 | 65 | /* 66 | PinChangeInt.h 67 | ---- VERSIONS --- (NOTE TO SELF: Update the PCINT_VERSION define, below) ----------------- 68 | Version 2.19 (beta) Tue Nov 20 07:33:37 CST 2012 69 | Version 2.17 (beta) Sat Nov 17 09:46:50 CST 2012 70 | Version 2.11 (beta) Mon Nov 12 09:33:06 CST 2012 71 | 72 | Version 2.01 (beta) Thu Jun 28 12:35:48 CDT 2012 73 | 74 | Version 1.72 Wed Mar 14 18:57:55 CDT 2012 75 | 76 | Version 1.71beta Sat Mar 10 12:57:05 CST 2012 77 | 78 | Version 1.6beta Fri Feb 10 08:48:35 CST 2012 79 | 80 | Version 1.51 Sun Feb 5 23:28:02 CST 2012 81 | 82 | Version 1.5 Thu Feb 2 18:09:49 CST 2012 83 | 84 | Version 1.4 Tue Jan 10 09:41:14 CST 2012 85 | 86 | Version 1.3 Sat Dec 3 22:56:20 CST 2011 87 | 88 | Version 1.2 Sat Dec 3 Sat Dec 3 09:15:52 CST 2011 89 | 90 | Version 1.1 Sat Dec 3 00:06:03 CST 2011 91 | */ 92 | 93 | #ifndef PinChangeInt_h 94 | #define PinChangeInt_h 95 | 96 | #define PCINT_VERSION 2190 // This number MUST agree with the version number, above. 97 | 98 | #include "stddef.h" 99 | 100 | // Thanks to Maurice Beelen, nms277, Akesson Karlpetter, and Orly Andico for these fixes. 101 | #if defined(ARDUINO) && ARDUINO >= 100 102 | #include 103 | #include 104 | #include // cby and sbi defined here 105 | #else 106 | #include 107 | #include 108 | #ifndef LIBCALL_PINCHANGEINT 109 | #include "../cppfix/cppfix.h" 110 | #endif 111 | #endif 112 | 113 | 114 | #undef DEBUG 115 | 116 | /* 117 | * Theory: all IO pins on Atmega168 are covered by Pin Change Interrupts. 118 | * The PCINT corresponding to the pin must be enabled and masked, and 119 | * an ISR routine provided. Since PCINTs are per port, not per pin, the ISR 120 | * must use some logic to actually implement a per-pin interrupt service. 121 | */ 122 | 123 | /* Pin to interrupt map: 124 | * D0-D7 = PCINT 16-23 = PCIR2 = PD = PCIE2 = pcmsk2 125 | * D8-D13 = PCINT 0-5 = PCIR0 = PB = PCIE0 = pcmsk0 126 | * A0-A5 (D14-D19) = PCINT 8-13 = PCIR1 = PC = PCIE1 = pcmsk1 127 | */ 128 | 129 | #undef INLINE_PCINT 130 | #define INLINE_PCINT 131 | // Thanks to cserveny...@gmail.com for MEGA support! 132 | #if defined __AVR_ATmega2560__ || defined __AVR_ATmega1280__ || defined __AVR_ATmega1281__ || defined __AVR_ATmega2561__ || defined __AVR_ATmega640__ 133 | #define __USE_PORT_JK 134 | // Mega does not have PORTA, C or D 135 | #define NO_PORTA_PINCHANGES 136 | #define NO_PORTC_PINCHANGES 137 | #define NO_PORTD_PINCHANGES 138 | #if ((defined(NO_PORTB_PINCHANGES) && defined(NO_PORTJ_PINCHANGES)) || \ 139 | (defined(NO_PORTJ_PINCHANGES) && defined(NO_PORTK_PINCHANGES)) || \ 140 | (defined(NO_PORTK_PINCHANGES) && defined(NO_PORTB_PINCHANGES))) 141 | #define INLINE_PCINT inline 142 | #endif 143 | #else 144 | #if defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644__) 145 | #ifndef NO_PORTA_PINCHANGES 146 | #define __USE_PORT_A 147 | #endif 148 | #else 149 | #define NO_PORTA_PINCHANGES 150 | #endif 151 | // if defined only D .OR. only C .OR. only B .OR. only A, then inline it 152 | #if ( (defined(NO_PORTA_PINCHANGES) && defined(NO_PORTB_PINCHANGES) && defined(NO_PORTC_PINCHANGES)) || \ 153 | (defined(NO_PORTA_PINCHANGES) && defined(NO_PORTB_PINCHANGES) && defined(NO_PORTD_PINCHANGES)) || \ 154 | (defined(NO_PORTA_PINCHANGES) && defined(NO_PORTC_PINCHANGES) && defined(NO_PORTD_PINCHANGES)) || \ 155 | (defined(NO_PORTB_PINCHANGES) && defined(NO_PORTC_PINCHANGES) && defined(NO_PORTD_PINCHANGES)) ) 156 | #define INLINE_PCINT inline 157 | #endif 158 | #endif 159 | 160 | // Provide drop in compatibility with johnboiles PCInt project at 161 | // http://www.arduino.cc/playground/Main/PcInt 162 | #define PCdetachInterrupt(pin) PCintPort::detachInterrupt(pin) 163 | #define PCattachInterrupt(pin,userFunc,mode) PCintPort::attachInterrupt(pin, userFunc,mode) 164 | #define PCgetArduinoPin() PCintPort::getArduinoPin() 165 | 166 | 167 | typedef void (*PCIntvoidFuncPtr)(void); 168 | 169 | class PCintPort { 170 | public: 171 | PCintPort(int index,int pcindex, volatile uint8_t& maskReg) : 172 | portInputReg(*portInputRegister(index)), 173 | portPCMask(maskReg), 174 | PCICRbit(1 << pcindex), 175 | portRisingPins(0), 176 | portFallingPins(0), 177 | firstPin(NULL) 178 | #ifdef PINMODE 179 | ,intrCount(0) 180 | #endif 181 | { 182 | #ifdef FLASH 183 | ledsetup(); 184 | #endif 185 | } 186 | volatile uint8_t& portInputReg; 187 | static int8_t attachInterrupt(uint8_t pin, PCIntvoidFuncPtr userFunc, int mode); 188 | static void detachInterrupt(uint8_t pin); 189 | INLINE_PCINT void PCint(); 190 | static volatile uint8_t curr; 191 | #ifndef NO_PIN_NUMBER 192 | static volatile uint8_t arduinoPin; 193 | #endif 194 | #ifndef NO_PIN_STATE 195 | static volatile uint8_t pinState; 196 | #endif 197 | #ifdef PINMODE 198 | static volatile uint8_t pinmode; 199 | static volatile uint8_t s_portRisingPins; 200 | static volatile uint8_t s_portFallingPins; 201 | static volatile uint8_t s_lastPinView; 202 | static volatile uint8_t s_pmask; 203 | static volatile char s_PORT; 204 | static volatile uint8_t s_changedPins; 205 | static volatile uint8_t s_portRisingPins_nCurr; 206 | static volatile uint8_t s_portFallingPins_nNCurr; 207 | static volatile uint8_t s_currXORlastPinView; 208 | volatile uint8_t intrCount; 209 | static volatile uint8_t s_count; 210 | static volatile uint8_t pcint_multi; 211 | static volatile uint8_t PCIFRbug; 212 | #endif 213 | #ifdef FLASH 214 | static void ledsetup(void); 215 | #endif 216 | 217 | protected: 218 | class PCintPin { 219 | public: 220 | PCintPin() : 221 | PCintFunc((PCIntvoidFuncPtr)NULL), 222 | mode(0) {} 223 | PCIntvoidFuncPtr PCintFunc; 224 | uint8_t mode; 225 | uint8_t mask; 226 | uint8_t arduinoPin; 227 | PCintPin* next; 228 | }; 229 | void enable(PCintPin* pin, PCIntvoidFuncPtr userFunc, uint8_t mode); 230 | int8_t addPin(uint8_t arduinoPin,PCIntvoidFuncPtr userFunc, uint8_t mode); 231 | volatile uint8_t& portPCMask; 232 | const uint8_t PCICRbit; 233 | volatile uint8_t portRisingPins; 234 | volatile uint8_t portFallingPins; 235 | volatile uint8_t lastPinView; 236 | PCintPin* firstPin; 237 | }; 238 | 239 | #ifndef LIBCALL_PINCHANGEINT // LIBCALL_PINCHANGEINT *********************************************** 240 | volatile uint8_t PCintPort::curr=0; 241 | #ifndef NO_PIN_NUMBER 242 | volatile uint8_t PCintPort::arduinoPin=0; 243 | #endif 244 | #ifndef NO_PIN_STATE 245 | volatile uint8_t PCintPort::pinState=0; 246 | #endif 247 | #ifdef PINMODE 248 | volatile uint8_t PCintPort::pinmode=0; 249 | volatile uint8_t PCintPort::s_portRisingPins=0; 250 | volatile uint8_t PCintPort::s_portFallingPins=0; 251 | volatile uint8_t PCintPort::s_lastPinView=0; 252 | volatile uint8_t PCintPort::s_pmask=0; 253 | volatile char PCintPort::s_PORT='x'; 254 | volatile uint8_t PCintPort::s_changedPins=0; 255 | volatile uint8_t PCintPort::s_portRisingPins_nCurr=0; 256 | volatile uint8_t PCintPort::s_portFallingPins_nNCurr=0; 257 | volatile uint8_t PCintPort::s_currXORlastPinView=0; 258 | volatile uint8_t PCintPort::s_count=0; 259 | volatile uint8_t PCintPort::pcint_multi=0; 260 | volatile uint8_t PCintPort::PCIFRbug=0; 261 | #endif 262 | 263 | #ifdef FLASH 264 | #define PINLED 13 265 | volatile uint8_t *led_port; 266 | uint8_t led_mask; 267 | uint8_t not_led_mask; 268 | boolean ledsetup_run=false; 269 | void PCintPort::ledsetup(void) { 270 | if (! ledsetup_run) { 271 | led_port=portOutputRegister(digitalPinToPort(PINLED)); 272 | led_mask=digitalPinToBitMask(PINLED); 273 | not_led_mask=led_mask^0xFF; 274 | pinMode(PINLED, OUTPUT); digitalWrite(PINLED, LOW); 275 | ledsetup_run=true; 276 | } 277 | }; 278 | #endif 279 | 280 | 281 | // ATMEGA 644 282 | // 283 | #if defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644__) // Sanguino, Mosquino uino bobino bonanafannafofino, me my momino... 284 | 285 | #ifndef NO_PORTA_PINCHANGES 286 | PCintPort portA=PCintPort(1, 0,PCMSK0); // port PB==2 (from Arduino.h, Arduino version 1.0) 287 | #endif 288 | #ifndef NO_PORTB_PINCHANGES 289 | PCintPort portB=PCintPort(2, 1,PCMSK1); // port PB==2 (from Arduino.h, Arduino version 1.0) 290 | #endif 291 | #ifndef NO_PORTC_PINCHANGES 292 | PCintPort portC=PCintPort(3, 2,PCMSK2); // port PC==3 (also in pins_arduino.c, Arduino version 022) 293 | #endif 294 | #ifndef NO_PORTD_PINCHANGES 295 | PCintPort portD=PCintPort(4, 3,PCMSK3); // port PD==4 296 | #endif 297 | 298 | #else // others 299 | 300 | #ifndef NO_PORTB_PINCHANGES 301 | PCintPort portB=PCintPort(2, 0,PCMSK0); // port PB==2 (from Arduino.h, Arduino version 1.0) 302 | #endif 303 | #ifndef NO_PORTC_PINCHANGES // note: no PORTC on MEGA 304 | PCintPort portC=PCintPort(3, 1,PCMSK1); // port PC==3 (also in pins_arduino.c, Arduino version 022) 305 | #endif 306 | #ifndef NO_PORTD_PINCHANGES // note: no PORTD on MEGA 307 | PCintPort portD=PCintPort(4, 2,PCMSK2); // port PD==4 308 | #endif 309 | 310 | #endif // defined __AVR_ATmega644__ 311 | 312 | #ifdef __USE_PORT_JK 313 | #ifndef NO_PORTJ_PINCHANGES 314 | PCintPort portJ=PCintPort(10,1,PCMSK1); // port PJ==10 315 | #endif 316 | #ifndef NO_PORTK_PINCHANGES 317 | PCintPort portK=PCintPort(11,2,PCMSK2); // port PK==11 318 | #endif 319 | #endif // USE_PORT_JK 320 | 321 | static PCintPort *lookupPortNumToPort( int portNum ) { 322 | PCintPort *port = NULL; 323 | 324 | switch (portNum) { 325 | #ifndef NO_PORTA_PINCHANGES 326 | case 1: 327 | port=&portA; 328 | break; 329 | #endif 330 | #ifndef NO_PORTB_PINCHANGES 331 | case 2: 332 | port=&portB; 333 | break; 334 | #endif 335 | #ifndef NO_PORTC_PINCHANGES 336 | case 3: 337 | port=&portC; 338 | break; 339 | #endif 340 | #ifndef NO_PORTD_PINCHANGES 341 | case 4: 342 | port=&portD; 343 | break; 344 | #endif 345 | #ifdef __USE_PORT_JK 346 | 347 | #ifndef NO_PORTJ_PINCHANGES 348 | case 10: 349 | port=&portJ; 350 | break; 351 | #endif 352 | 353 | #ifndef NO_PORTK_PINCHANGES 354 | case 11: 355 | port=&portK; 356 | break; 357 | #endif 358 | 359 | #endif 360 | } 361 | 362 | return port; 363 | } 364 | 365 | 366 | void PCintPort::enable(PCintPin* p, PCIntvoidFuncPtr userFunc, uint8_t mode) { 367 | // Enable the pin for interrupts by adding to the PCMSKx register. 368 | // ...The final steps; at this point the interrupt is enabled on this pin. 369 | p->mode=mode; 370 | p->PCintFunc=userFunc; 371 | portPCMask |= p->mask; 372 | if ((p->mode == RISING) || (p->mode == CHANGE)) portRisingPins |= p->mask; 373 | if ((p->mode == FALLING) || (p->mode == CHANGE)) portFallingPins |= p->mask; 374 | PCICR |= PCICRbit; 375 | } 376 | 377 | int8_t PCintPort::addPin(uint8_t arduinoPin, PCIntvoidFuncPtr userFunc, uint8_t mode) 378 | { 379 | PCintPin* tmp; 380 | 381 | // Add to linked list, starting with firstPin. If pin already exists, just enable. 382 | if (firstPin != NULL) { 383 | tmp=firstPin; 384 | do { 385 | if (tmp->arduinoPin == arduinoPin) { enable(tmp, userFunc, mode); return(0); } 386 | if (tmp->next == NULL) break; 387 | tmp=tmp->next; 388 | } while (true); 389 | } 390 | 391 | // Create pin p: fill in the data. 392 | PCintPin* p=new PCintPin; 393 | if (p == NULL) return(-1); 394 | p->arduinoPin=arduinoPin; 395 | p->mode = mode; 396 | p->next=NULL; 397 | p->mask = digitalPinToBitMask(arduinoPin); // the mask 398 | 399 | if (firstPin == NULL) firstPin=p; 400 | else tmp->next=p; 401 | 402 | #ifdef DEBUG 403 | Serial.print("addPin. pin given: "); Serial.print(arduinoPin, DEC); 404 | int addr = (int) p; 405 | Serial.print(" instance addr: "); Serial.println(addr, HEX); 406 | Serial.print("userFunc addr: "); Serial.println((int)p->PCintFunc, HEX); 407 | #endif 408 | 409 | enable(p, userFunc, mode); 410 | #ifdef DEBUG 411 | Serial.print("addPin. pin given: "); Serial.print(arduinoPin, DEC), Serial.print (" pin stored: "); 412 | int addr = (int) p; 413 | Serial.print(" instance addr: "); Serial.println(addr, HEX); 414 | #endif 415 | return(1); 416 | } 417 | 418 | /* 419 | * attach an interrupt to a specific pin using pin change interrupts. 420 | */ 421 | int8_t PCintPort::attachInterrupt(uint8_t arduinoPin, PCIntvoidFuncPtr userFunc, int mode) 422 | { 423 | PCintPort *port; 424 | uint8_t portNum = digitalPinToPort(arduinoPin); 425 | if ((portNum == NOT_A_PORT) || (userFunc == NULL)) return(-1); 426 | 427 | port=lookupPortNumToPort(portNum); 428 | // Added by GreyGnome... must set the initial value of lastPinView for it to be correct on the 1st interrupt. 429 | // ...but even then, how do you define "correct"? Ultimately, the user must specify (not provisioned for yet). 430 | port->lastPinView=port->portInputReg; 431 | 432 | #ifdef DEBUG 433 | Serial.print("attachInterrupt FUNC: "); Serial.println(arduinoPin, DEC); 434 | #endif 435 | // map pin to PCIR register 436 | return(port->addPin(arduinoPin,userFunc,mode)); 437 | } 438 | 439 | void PCintPort::detachInterrupt(uint8_t arduinoPin) 440 | { 441 | PCintPort *port; 442 | PCintPin* current; 443 | uint8_t mask; 444 | #ifdef DEBUG 445 | Serial.print("detachInterrupt: "); Serial.println(arduinoPin, DEC); 446 | #endif 447 | uint8_t portNum = digitalPinToPort(arduinoPin); 448 | if (portNum == NOT_A_PORT) return; 449 | port=lookupPortNumToPort(portNum); 450 | mask=digitalPinToBitMask(arduinoPin); 451 | current=port->firstPin; 452 | //PCintPin* prev=NULL; 453 | while (current) { 454 | if (current->mask == mask) { // found the target 455 | uint8_t oldSREG = SREG; 456 | cli(); // disable interrupts 457 | port->portPCMask &= ~mask; // disable the mask entry. 458 | if (port->portPCMask == 0) PCICR &= ~(port->PCICRbit); 459 | port->portRisingPins &= ~current->mask; port->portFallingPins &= ~current->mask; 460 | // Link the previous' next to the found next. Then remove the found. 461 | //if (prev != NULL) prev->next=current->next; // linked list skips over current. 462 | //else firstPin=current->next; // at the first pin; save the new first pin 463 | SREG = oldSREG; // Restore register; reenables interrupts 464 | return; 465 | } 466 | //prev=current; 467 | current=current->next; 468 | } 469 | } 470 | 471 | // common code for isr handler. "port" is the PCINT number. 472 | // there isn't really a good way to back-map ports and masks to pins. 473 | void PCintPort::PCint() { 474 | uint8_t thisChangedPin; //MIKE 475 | 476 | #ifdef FLASH 477 | if (*led_port & led_mask) *led_port&=not_led_mask; 478 | else *led_port|=led_mask; 479 | #endif 480 | #ifndef DISABLE_PCINT_MULTI_SERVICE 481 | uint8_t pcifr; 482 | while (true) { 483 | #endif 484 | // get the pin states for the indicated port. 485 | #ifdef PINMODE 486 | PCintPort::s_lastPinView=lastPinView; 487 | intrCount++; 488 | PCintPort::s_count=intrCount; 489 | #endif 490 | // OLD v. 2.01 technique: Test 1: 3163; Test 7: 3993 491 | // From robtillaart online: ------------ (starting v. 2.11beta) 492 | // uint8_t changedPins = PCintPort::curr ^ lastPinView; 493 | // lastPinView = PCintPort::curr; 494 | // uint8_t fastMask = changedPins & ((portRisingPins & PCintPort::curr ) | ( portFallingPins & ~PCintPort::curr )); 495 | // NEW v. 2.11 technique: Test 1: 3270 Test 7: 3987 496 | // ------------------------------------- 497 | // was: uint8_t changedPins = PCintPort::curr ^ lastPinView; 498 | // makes test 6 of the PinChangeIntSpeedTest go from 3867 to 3923. Not good. 499 | uint8_t changedPins = (PCintPort::curr ^ lastPinView) & 500 | ((portRisingPins & PCintPort::curr ) | ( portFallingPins & ~PCintPort::curr )); 501 | 502 | #ifdef PINMODE 503 | PCintPort::s_currXORlastPinView=PCintPort::curr ^ lastPinView; 504 | PCintPort::s_portRisingPins_nCurr=portRisingPins & PCintPort::curr; 505 | PCintPort::s_portFallingPins_nNCurr=portFallingPins & ~PCintPort::curr; 506 | #endif 507 | lastPinView = PCintPort::curr; 508 | 509 | PCintPin* p = firstPin; 510 | while (p) { 511 | // Trigger interrupt if the bit is high and it's set to trigger on mode RISING or CHANGE 512 | // Trigger interrupt if the bit is low and it's set to trigger on mode FALLING or CHANGE 513 | thisChangedPin=p->mask & changedPins; // PinChangeIntSpeedTest makes this 3673... weird. But GOOD!!! 514 | if (p->mask & changedPins) { 515 | #ifndef NO_PIN_STATE 516 | PCintPort::pinState=PCintPort::curr & p->mask ? HIGH : LOW; 517 | #endif 518 | #ifndef NO_PIN_NUMBER 519 | PCintPort::arduinoPin=p->arduinoPin; 520 | #endif 521 | #ifdef PINMODE 522 | PCintPort::pinmode=p->mode; 523 | PCintPort::s_portRisingPins=portRisingPins; 524 | PCintPort::s_portFallingPins=portFallingPins; 525 | PCintPort::s_pmask=p->mask; 526 | PCintPort::s_changedPins=changedPins; 527 | #endif 528 | p->PCintFunc(); 529 | } 530 | p=p->next; 531 | } 532 | #ifndef DISABLE_PCINT_MULTI_SERVICE 533 | pcifr = PCIFR & PCICRbit; 534 | if (pcifr == 0) break; 535 | PCIFR |= PCICRbit; 536 | #ifdef PINMODE 537 | PCintPort::pcint_multi++; 538 | if (PCIFR & PCICRbit) PCintPort::PCIFRbug=1; // PCIFR & PCICRbit should ALWAYS be 0 here! 539 | #endif 540 | PCintPort::curr=portInputReg; 541 | } 542 | #endif 543 | } 544 | 545 | #ifndef NO_PORTA_PINCHANGES 546 | ISR(PCINT0_vect) { 547 | #ifdef PINMODE 548 | PCintPort::s_PORT='A'; 549 | #endif 550 | PCintPort::curr = portA.portInputReg; 551 | portA.PCint(); 552 | } 553 | #define PORTBVECT PCINT1_vect 554 | #define PORTCVECT PCINT2_vect 555 | #define PORTDVECT PCINT3_vect 556 | #else 557 | #define PORTBVECT PCINT0_vect 558 | #define PORTCVECT PCINT1_vect 559 | #define PORTDVECT PCINT2_vect 560 | #endif 561 | 562 | #ifndef NO_PORTB_PINCHANGES 563 | ISR(PORTBVECT) { 564 | #ifdef PINMODE 565 | PCintPort::s_PORT='B'; 566 | #endif 567 | PCintPort::curr = portB.portInputReg; 568 | portB.PCint(); 569 | } 570 | #endif 571 | 572 | #ifndef NO_PORTC_PINCHANGES 573 | ISR(PORTCVECT) { 574 | #ifdef PINMODE 575 | PCintPort::s_PORT='C'; 576 | #endif 577 | PCintPort::curr = portC.portInputReg; 578 | portC.PCint(); 579 | } 580 | #endif 581 | 582 | #ifndef NO_PORTD_PINCHANGES 583 | ISR(PORTDVECT){ 584 | #ifdef PINMODE 585 | PCintPort::s_PORT='D'; 586 | #endif 587 | PCintPort::curr = portD.portInputReg; 588 | portD.PCint(); 589 | } 590 | #endif 591 | 592 | #ifdef __USE_PORT_JK 593 | #ifndef NO_PORTJ_PINCHANGES 594 | ISR(PCINT1_vect) { 595 | #ifdef PINMODE 596 | PCintPort::s_PORT='J'; 597 | #endif 598 | PCintPort::curr = portJ.portInputReg; 599 | portJ.PCint(); 600 | } 601 | #endif 602 | 603 | #ifndef NO_PORTK_PINCHANGES 604 | ISR(PCINT2_vect){ 605 | #ifdef PINMODE 606 | PCintPort::s_PORT='K'; 607 | #endif 608 | PCintPort::curr = portK.portInputReg; 609 | portK.PCint(); 610 | } 611 | #endif 612 | 613 | #endif // __USE_PORT_JK 614 | 615 | #ifdef GET_PCINT_VERSION 616 | uint16_t getPCIntVersion () { 617 | return ((uint16_t) PCINT_VERSION); 618 | } 619 | #endif // GET_PCINT_VERSION 620 | #endif // #ifndef LIBCALL_PINCHANGEINT ************************************************************* 621 | #endif // #ifndef PinChangeInt_h ******************************************************************* 622 | -------------------------------------------------------------------------------- /example/lib/PinChangeInt/RELEASE_NOTES: -------------------------------------------------------------------------------- 1 | ****************************************************************************** 2 | 3 | PinChangeInt 4 | ---- RELEASE NOTES --- 5 | 6 | Version 2.19 (beta) Tue Nov 20 07:33:37 CST 2012 7 | SANGUINO SUPPORT! ...And Mioduino! 8 | ...The ATmega644 chip is so cool, how can I not? 4 full ports of Pin Change Interrupt bliss! 32 i/o pins! 64k Flash! 4k RAM! Well I wish I had one. That said, Sanguino users, PLEASE send in your bug or bliss reports! Your interrupt-loving brethren and sistren are depending on you, so I can assure everyone that my changes work on that platform. Thanks. 9 | 10 | Modified the addPin() method to save 12 bytes; thanks again robtilllart! 11 | if (firstPin != NULL) { 12 | tmp=firstPin; 13 | do { 14 | if (tmp->arduinoPin == arduinoPin) { enable(tmp, userFunc, mode); return(0); } 15 | if (tmp->next == NULL) break; 16 | tmp=tmp->next; 17 | } while (true); 18 | } 19 | Also changed the goto in the PCint() loop to be a while/break combination. No change to 20 | code speed, but it looks better and passes the cleanliness "gut check". 21 | 22 | Includes PinChangeIntTest 1.5 sketch. 23 | 24 | ...Ooops! Forgot the GetPSTR library, needed for the PinChangeIntTest code! Now it's included. 25 | ****************************************************************************** 26 | Version 2.17 (beta) Sat Nov 17 09:46:50 CST 2012 27 | Another bugfix in the PCINT_MULTI_SERVICE section. I was using sbi(PCIFR, PCICRbit); 28 | I didn't realize that was for I/O ports, and not ATmega registers. 29 | But according to "deprecated.h", 30 | "These macros became obsolete, as reading and writing IO ports can 31 | be done by simply using the IO port name in an expression, and all 32 | bit manipulation (including those on IO ports) can be done using 33 | generic C bit manipulation operators." 34 | So now I do: 35 | PCIFR |= PCICRbit; 36 | ****************************************************************************** 37 | Version 2.15 (beta) Sat Nov 17 01:17:44 CST 2012 38 | Fixed it so that attachInterrupt() will now follow your changes to the user function, 39 | as well as the mode. detachInterrupt() still does not delete the PCintPin object but 40 | at least you can detach and reattach at will, using different modes (RISING, FALLING, 41 | CHANGE) and different functions as you wish. 42 | 43 | ****************************************************************************** 44 | Version 2.13 (beta) Mon Nov 12 09:33:06 CST 2012 45 | SIGNIFICANT BUGFIX release! Significant changes: 46 | 1. PCintPort::curr bug. Interrupts that occur rapidly will likely not get serviced properly by PCint(). 47 | 2. PCint() interrupt handler optimization. 48 | 3. PCIFR port bit set bug fix. 49 | 4. Many static variables added for debugging; used only when #define PINMODE is on. 50 | 5. detachInterrupt() no longer does a delete(), since that wasn't working anyway. When you detachInterrupt(), the PORT just disables interrupts for that pin; the PCintPin object remains in memory and in the linked list of pins (possibly slowing down your interrupts a couple of micros). You can reenable a detached interrupt- but you must do it within the PinChangeInt library (would anyone ever enable an interrupt on a pin, then disable it, then have need to reenable it but not using the library?). 51 | 6. attachInterrupt() now returns a uint8_t value: 1 on successful attach, 0 on successful attach but using an already-enabled pin, and -1 if the new() operator failed to create a PCintPin object. 52 | Also, modified these release notes. 53 | 54 | Details: 55 | 56 | Uncovered a nasty bug, thanks to robtillaart on the Arduino Forums and Andre' Franken who posted to the PinChangeInt groups. This bug was introduced by me when I assigned PCintPort::curr early in the interrupt handler: 57 | ISR(PCINT0_vect) { 58 | PCintPort::curr = portB.portInputReg; 59 | portB.PCint(); 60 | } 61 | Later, in the interrupt handler PCint(), we loop as long as PCIFR indicates a new interrupt wants to be triggered, provided DISABLE_PCINT_MULTI_SERVICE is not defined (it is not by default): 62 | #ifndef DISABLE_PCINT_MULTI_SERVICE 63 | pcifr = PCIFR & PCICRbit; 64 | PCIFR = pcifr; // clear the interrupt if we will process it (no effect if bit is zero) 65 | } while(pcifr); 66 | #endif 67 | ...Well. Problem is, if a pin pops up and causes the PCIFR to change, we have to reread the port and look at how it is now! I wasn't doing that before, so if a new interrupt appeared while I was still servicing the old one, odd behavior would take place. For example, an interrupt would register but then the userFunc would not be called upon to service it. The code needs to be: 68 | pcifr = PCIFR & PCICRbit; 69 | PCIFR = pcifr; // clear the interrupt if we will process it (no effect if bit is zero) 70 | PCintPort::curr=portInputReg; // ...Fixed in 2.11beta. 71 | } while(pcifr); 72 | 73 | Also, made the interrupt handler even faster with an optimization from robtillaart to take out the checks for changed pins from the while() loop that steps through the pins: 74 | uint8_t changedPins = (PCintPort::curr ^ lastPinView) & 75 | ((portRisingPins & PCintPort::curr ) | ( portFallingPins & ~PCintPort::curr )); 76 | 77 | ...This speedup is offset by more changes in the PCint() handler, which now looks like the following; there are two bug fixes: 78 | ---------------------------- 79 | FIX 1: sbi(PCIFR, PCICRbit); 80 | FIX 2: ...the aforementioned PCintPort::curr=portInputReg; 81 | Here's the new code: 82 | ---------------------------- 83 | #ifndef DISABLE_PCINT_MULTI_SERVICE 84 | pcifr = PCIFR & PCICRbit; 85 | if (pcifr) { 86 | //if (PCIFR & PCICRbit) { // believe it or not, this adds .6 micros 87 | sbi(PCIFR, PCICRbit); // This was a BUG: PCIFR = pcifr ...And here is the fix. 88 | #ifdef PINMODE 89 | PCintPort::pcint_multi++; 90 | if (PCIFR & PCICRbit) PCintPort::PCIFRbug=1; // PCIFR & PCICRbit should ALWAYS be 0 here! 91 | #endif 92 | PCintPort::curr=portInputReg; // ...Fixed in 2.11beta. 93 | goto loop; // A goto!!! Don't want to look at the portInputReg gratuitously, so the while() will not do. 94 | } 95 | #endif 96 | 97 | Also I added a lot of variables for debugging when PINMODE is defined, for routing out nasty bugs. I may need them in the future... :-( 98 | 99 | Finally, I am not putting newlines in this commentary so I can make it easier to paste online. 100 | 101 | ****************************************************************************** 102 | Version 2.11 (beta) Mon Nov 12 09:33:06 CST 2012 103 | See version 2.13 (beta) above. No change other than tidying up the release notes. 104 | ****************************************************************************** 105 | Version 2.01 (beta) Thu Jun 28 12:35:48 CDT 2012 106 | ...Wow, Version 2! What? Why? 107 | Modified the way that the pin is tested inside the interrupt subroutine (ISR) PCintPort::PCint(), 108 | to make the interrupt quicker and slightly reduce the memory footprint. The interrupt's time is 109 | reduced by 2 microseconds or about 7%. Instead of using the mode variable, two bitmasks are maintained 110 | for each port. One bitmask contains all the pins that are configured to work on RISING signals, the other 111 | on FALLING signals. A pin configured to work on CHANGE signals will appear in both bitmasks of the port. 112 | Then, the test for a change goes like this: 113 | if (thisChangedPin) { 114 | if ((thisChangedPin & portRisingPins & PCintPort::curr ) || 115 | (thisChangedPin & portFallingPins & ~PCintPort::curr )) { 116 | where portRisingPins is the bitmask for the pins configured to interrupt on RISING signals, and 117 | portFallingPins is the bitmask for the pins configured to interrupt on FALLING signals. Each port includes 118 | these two bitmask variables. 119 | 120 | This is a significant change to some core functionality to the library, and it saves an appreciable amount 121 | of time (2 out of 36 or so micros). Hence, the 2.00 designation. 122 | 123 | Tue Jun 26 12:42:20 CDT 2012 124 | I was officially given permission to use the PCint library: 125 | 126 | Re: PCint library 127 | « Sent to: GreyGnome on: Today at 08:10:33 AM » 128 | « You have forwarded or responded to this message. » 129 | Quote Reply Remove 130 | HI, 131 | Yeah, I wrote the original PCint library. It was a bit of a hack and the new one has better features. 132 | I intended the code to be freely usable. Didn't really think about a license. Feel free to use it in 133 | your code: I hereby grant you permission. 134 | 135 | I'll investigate the MIT license, and see if it is appropriate. 136 | Chris J. Kiick 137 | Robot builder and all around geek. 138 | 139 | Version 1.81 (beta) Tue Jun 19 07:29:08 CDT 2012 140 | Created the getPCIntVersion function, and its associated GET_PCINT_VERSION preprocessor macro. The version 141 | is a 16-bit int, therefore versions are represented as a 4-digit integer. 1810, then, is the first beta 142 | release of 1.81x series. 1811 would be a bugfix of 1.810. 1820 would be the production release. 143 | 144 | Reversed the order of this list, so the most recent notes come first. 145 | 146 | Made some variables "volatile", because they are changed in the interrupt code. Thanks, Tony Cappellini! 147 | 148 | Added support for the Arduino Mega! Thanks to cserveny...@gmail.com! 149 | NOTE: I don't have a Mega, so I rely on you to give me error (or working) reports! 150 | To sum it up for the Mega: No Port C, no Port D. Instead, you get Port J and Port K. Port B remains. 151 | Port J, however, is practically useless because there is only 1 pin available for interrupts. 152 | Most of the Port J pins are not even connected to a header connector. Caveat Programmer. 153 | 154 | Created a function to report the version of this code. Put this #define ahead of the #include of this file, 155 | in your sketch: 156 | #define GET_PCINT_VERSION 157 | Then you can call 158 | uint16_t getPCIntVersion (); 159 | and it will return a 16-bit integer representation of the version of this library. That is, version 1.73beta 160 | will be reported as "1730". 1.74, then, will return "1740". And so on, for whatever version of the library 161 | this happens to be. The odd number in the 10's position will indicate a beta version, as per usual, and the 162 | number in the 1s place will indicate the beta revision (bugs may necessitate a 1.731, 1.732, etc.). 163 | 164 | Here are some of his notes based on his changes: 165 | Mega and friends are using port B, J and K for interrupts. B is working without any modifications. 166 | 167 | J is mostly useless, because of the hardware UART. I was not able to get pin change notifications from 168 | the TX pin (14), so only 15 left. All other (PORT J) pins are not connected on the Arduino boards. 169 | 170 | K controls Arduino pin A8-A15, working fine. 171 | 172 | 328/168 boards use C and D. So in case the lib is compiled with Mega target, the C and D will be 173 | disabled. Also you cannot see port J/K with other targets. For J and K new flags introduced: 174 | NO_PORTJ_PINCHANGES and NO_PORTK_PINCHANGES. 175 | Maybe we should have PORTJ_PINCHANGES to enable PJ, because they will be most likely unused. 176 | 177 | Enjoy! 178 | 179 | Note: To remain consistent, I have not included PORTJ_PINCHANGES. All ports behave the same, 180 | no matter how trivial those ports may seem... no surprises... 181 | 182 | Version 1.72 Wed Mar 14 18:57:55 CDT 2012 183 | Release. 184 | 185 | Version 1.71beta Sat Mar 10 12:57:05 CST 2012 186 | Code reordering: Starting in version 1.3 of this library, I put the code that enables 187 | interrupts for the given pin, and the code that enables Pin Change Interrupts, ahead of actually 188 | setting the user's function for the pin. Thus in the small interval between turning on the 189 | interrupts and actually creating a valid link to an interrupt handler, it is possible to get an 190 | interrupt. At that point the value of the pointer is 0, so this means that the Arduino 191 | will start over again from memory location 0- just as if you'd pressed the reset button. Oops! 192 | 193 | I corrected it so the code now operates in the proper order. 194 | (EDITORIAL NOTE: If you want to really learn something, teach it!) 195 | 196 | Minor code clean-up: All references to PCintPort::curr are now explicit. This changes the compiled 197 | hex code not one whit. I just sleep better at night. 198 | 199 | Numbering: Changed the numbering scheme. Beta versions will end with an odd number in the hundredths 200 | place- because they may be odd- and continue to be marked "beta". I'll just sleep better at night. :-) 201 | 202 | Version 1.70beta Mon Feb 27 07:20:42 CST 2012 203 | Happy Birthday to me! Happy Birthday tooooo meee! Happy Birthday, Dear Meeeeee-eeeee! 204 | Happy Birthday to me! 205 | 206 | Yes, it is on this auspicious occasion of mine (and Elizabeth Taylor's [R.I.P.]) birthday that I 207 | humbly submit to you, gracious Arduino PinChangeInt user, version 1.70beta of the PinChangeInt 208 | library. I hope you enjoy it. 209 | 210 | New in this release: 211 | The PinChangeIntTest sketch was created, which can be found in the Examples directory. It exercises: 212 | * Two interrupting pins, one on each of the Arduino's PORTs. 213 | * detachInterrupt() (and subsequent attachInterrupt()s). 214 | Hopefully this will help avoid the embarrassing bugs that I have heretofore missed. 215 | 216 | As well, it has come to this author's (GreyGnome) attention that the Serial class in Arduino 1.0 217 | uses an interrupt that, if you attempt to print from an interrupt (which is what I was doing in my 218 | tests) can easily lock up the Arduino. So I have taken SigurðurOrn's excellent ByteBuffer library 219 | and modified it for my own nefarious purposes. (see http://siggiorn.com/?p=460). The zipfile 220 | comes complete with the ByteBuffer library; see the ByteBuffer/ByteBuffer.h file for a list of 221 | changes, and see the PinChangeIntTest sketch for a usage scenario. Now the (interrupt-less and) 222 | relatively fast operation of filling a circular buffer is used in the interrupt routines. The buffer 223 | is then printed from loop(). 224 | 225 | The library has been modified so it can be used in other libraries, such as my AdaEncoder library 226 | (http://code.google.com/p/adaencoder/). When #include'd by another library you should #define 227 | the LIBCALL_PINCHANGEINT macro. For example: 228 | #ifndef PinChangeInt_h 229 | #define LIBCALL_PINCHANGEINT 230 | #include "../PinChangeInt/PinChangeInt.h" 231 | #endif 232 | This is necessary because the IDE compiles both your sketch and the .cpp file of your library, and 233 | the .h file is included in both places. But since the .h file actually contains the code, any variable 234 | or function definitions would occur twice and cause compilation errors- unless #ifdef'ed out. 235 | 236 | Version 1.6beta Fri Feb 10 08:48:35 CST 2012 237 | Set the value of the current register settings, first thing in each ISR; e.g., 238 | ISR(PCINT0_vect) { 239 | PCintPort::curr = portB.portInputReg; // version 1.6 240 | ... 241 | ...instead of at the beginning of the PCintPort::PCint() static method. This means that the port is read 242 | closer to the beginning of the interrupt, and may be slightly more accurate- only by a couple of microseconds, 243 | really, but it's a cheap win. 244 | 245 | Fixed a bug- a BUG!- in the attachInterrupt() and detachInterrupt() methods. I didn't have breaks in my 246 | switch statements! Augh! What am I, a (UNIX) shell programmer? ...Uh, generally, yes... 247 | 248 | Added the PINMODE define and the PCintPort::pinmode variable. 249 | 250 | Version 1.51 Sun Feb 5 23:28:02 CST 2012 251 | Crap, a bug! Changed line 392 from this: 252 | PCintPort::pinState=curr & changedPins ? HIGH : LOW; 253 | to this: 254 | PCintPort::pinState=curr & p->mask ? HIGH : LOW; 255 | Also added a few lines of (commented-out) debug code. 256 | 257 | Version 1.5 Thu Feb 2 18:09:49 CST 2012 258 | Added the PCintPort::pinState static variable to allow the programmer to query the state of the pin 259 | at the time of interrupt. 260 | Added two new #defines, NO_PIN_STATE and NO_PIN_NUMBER so as to reduce the code size by 20-50 bytes, 261 | and to speed up the interrupt routine slightly by declaring that you don't care if the static variables 262 | PCintPort::pinState and/or PCintPort::arduinoPin are set and made available to your interrupt routine. 263 | // #define NO_PIN_STATE // to indicate that you don't need the pinState 264 | // #define NO_PIN_NUMBER // to indicate that you don't need the arduinoPin 265 | 266 | Version 1.4 Tue Jan 10 09:41:14 CST 2012 267 | All the code has been moved into this .h file, so as to allow #define's to work from the user's 268 | sketch. Thanks to Paul Stoffregen from pjrc.com for the inspiration! (Check out his website for 269 | some nice [lots more memory] Arduino-like boards at really good prices. ...This has been an unsolicited 270 | plug. Now back to our regular programming. ...Hehe, "programming", get it?) 271 | 272 | As a result, we no longer use the PinChangeIntConfig.h file. The user must #define things in his/her 273 | sketch. Which is better anyway. 274 | 275 | Removed the pcIntPorts[] array, which created all the ports by default no matter what. Now, only 276 | those ports (PCintPort objects) that you need will get created if you use the NO_PORTx_PINCHANGES #defines. 277 | This saves flash memory, and actually we get a bit of a memory savings anyway even if all the ports are 278 | left enabled. 279 | 280 | The attachInterrupt and detachInterrupt routines were modified to handle the new PCintPort objects. 281 | 282 | Version 1.3 Sat Dec 3 22:56:20 CST 2011 283 | Significant internal changes: 284 | Tested and modified to work with Arduino 1.0. 285 | 286 | Modified to use the new() operator and symbolic links instead of creating a pre-populated 287 | PCintPins[]. Renamed some variables to simplify or make their meaning more obvious (IMHO anyway). 288 | Modified the PCintPort::PCint() code (ie, the interrupt code) to loop over a linked-list. For 289 | those who love arrays, I have left some code in there that should work to loop over an array 290 | instead. But it is commented out in the release version. 291 | 292 | For Arduino versions prior to 1.0: The new() operator requires the cppfix.h library, which is 293 | included with this package. For Arduino 1.0 and above: new.h comes with the distribution, and 294 | that is #included. 295 | 296 | Version 1.2 Sat Dec 3 Sat Dec 3 09:15:52 CST 2011 297 | Modified Thu Sep 8 07:33:17 CDT 2011 by GreyGnome. Fixes a bug with the initial port 298 | value. Now it sets the initial value to be the state of the port at the time of 299 | attachInterrupt(). The line is port.PCintLast=port.portInputReg; in attachInterrupt(). 300 | See GreyGnome comment, below. 301 | 302 | Added the "arduinoPin" variable, so the user's function will know exactly which pin on 303 | the Arduino was triggered. 304 | 305 | Version 1.1 Sat Dec 3 00:06:03 CST 2011 306 | ...updated to fix the "delPin" function as per "pekka"'s bug report. Thanks! 307 | 308 | ---- ^^^ VERSIONS ^^^ (NOTE TO SELF: Update the PCINT_VERSION define, below) ------------- 309 | 310 | See google code project for latest, bugs and info http://code.google.com/p/arduino-pinchangeint/ 311 | For more information Refer to avr-gcc header files, arduino source and atmega datasheet. 312 | 313 | This library was inspired by and derived from "johnboiles" (it seems) 314 | PCInt Arduino Playground example here: http://www.arduino.cc/playground/Main/PcInt 315 | If you are the original author, please let us know at the google code page 316 | 317 | It provides an extension to the interrupt support for arduino by 318 | adding pin change interrupts, giving a way for users to have 319 | interrupts drive off of any pin. 320 | 321 | This program is free software: you can redistribute it and/or modify 322 | it under the terms of the GNU General Public License as published by 323 | the Free Software Foundation, either version 3 of the License, or 324 | (at your option) any later version. 325 | 326 | This program is distributed in the hope that it will be useful, 327 | but WITHOUT ANY WARRANTY; without even the implied warranty of 328 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 329 | GNU General Public License for more details. 330 | 331 | You should have received a copy of the GNU General Public License 332 | along with this program. If not, see . 333 | -------------------------------------------------------------------------------- /example/lib/PinChangeInt/keywords.txt: -------------------------------------------------------------------------------- 1 | # LITERAL1 specifies constants 2 | 3 | # KEYWORD1 specifies datatypes and C/C++ keywords 4 | pinState KEYWORD1 PinState 5 | arduinoPin KEYWORD1 ArduinoPin 6 | PCintPort KEYWORD1 PCInterruptPort 7 | 8 | # KEYWORD2 specifies methods and functions 9 | attachInterrupt KEYWORD2 AttachInterrupt 10 | detachInterrupt KEYWORD2 DetachInterrupt 11 | -------------------------------------------------------------------------------- /example/lib/RCArduinoFastLib: -------------------------------------------------------------------------------- 1 | ../../RCArduinoFastLib/ -------------------------------------------------------------------------------- /example/src/sketch.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | // MultiChannels 4 | // 5 | // rcarduino.blogspot.com 6 | // 7 | // A simple approach for reading three RC Channels using pin change interrupts 8 | // 9 | // See related posts - 10 | // http://rcarduino.blogspot.co.uk/2012/01/how-to-read-rc-receiver-with.html 11 | // http://rcarduino.blogspot.co.uk/2012/03/need-more-interrupts-to-read-more.html 12 | // http://rcarduino.blogspot.co.uk/2012/01/can-i-control-more-than-x-servos-with.html 13 | // 14 | // rcarduino.blogspot.com 15 | // 16 | 17 | // include the pinchangeint library - see the links in the related topics section above for details 18 | #include 19 | 20 | // Assign your channel in pins 21 | #define THROTTLE_IN_PIN 5 22 | #define STEERING_IN_PIN 6 23 | #define AUX_IN_PIN 7 24 | 25 | // Assign your channel out pins 26 | #define THROTTLE_OUT_PIN 8 27 | #define STEERING_OUT_PIN 9 28 | #define AUX_OUT_PIN 10 29 | 30 | // Assign servo indexes 31 | #define SERVO_THROTTLE 0 32 | #define SERVO_STEERING 1 33 | #define SERVO_AUX 2 34 | #define SERVO_FRAME_SPACE 3 35 | 36 | // These bit flags are set in bUpdateFlagsShared to indicate which 37 | // channels have new signals 38 | #define THROTTLE_FLAG 1 39 | #define STEERING_FLAG 2 40 | #define AUX_FLAG 4 41 | 42 | // holds the update flags defined above 43 | volatile uint8_t bUpdateFlagsShared; 44 | 45 | // shared variables are updated by the ISR and read by loop. 46 | // In loop we immediatley take local copies so that the ISR can keep ownership of the 47 | // shared ones. To access these in loop 48 | // we first turn interrupts off with noInterrupts 49 | // we take a copy to use in loop and the turn interrupts back on 50 | // as quickly as possible, this ensures that we are always able to receive new signals 51 | volatile uint16_t unThrottleInShared; 52 | volatile uint16_t unSteeringInShared; 53 | volatile uint16_t unAuxInShared; 54 | 55 | // These are used to record the rising edge of a pulse in the calcInput functions 56 | // They do not need to be volatile as they are only used in the ISR. If we wanted 57 | // to refer to these in loop and the ISR then they would need to be declared volatile 58 | uint16_t unThrottleInStart; 59 | uint16_t unSteeringInStart; 60 | uint16_t unAuxInStart; 61 | 62 | uint16_t unLastAuxIn = 0; 63 | uint32_t ulVariance = 0; 64 | uint32_t ulGetNextSampleMillis = 0; 65 | uint16_t unMaxDifference = 0; 66 | 67 | void setup() 68 | { 69 | Serial.begin(115200); 70 | 71 | Serial.println("multiChannels"); 72 | 73 | // attach servo objects, these will generate the correct 74 | // pulses for driving Electronic speed controllers, servos or other devices 75 | // designed to interface directly with RC Receivers 76 | CRCArduinoFastServos::attach(SERVO_THROTTLE,THROTTLE_OUT_PIN); 77 | CRCArduinoFastServos::attach(SERVO_STEERING,STEERING_OUT_PIN); 78 | CRCArduinoFastServos::attach(SERVO_AUX,AUX_OUT_PIN); 79 | 80 | // lets set a standard rate of 50 Hz by setting a frame space of 10 * 2000 = 3 Servos + 7 times 2000 81 | CRCArduinoFastServos::setFrameSpaceA(SERVO_FRAME_SPACE,7*2000); 82 | 83 | CRCArduinoFastServos::begin(); 84 | 85 | // using the PinChangeInt library, attach the interrupts 86 | // used to read the channels 87 | PCintPort::attachInterrupt(THROTTLE_IN_PIN, calcThrottle,CHANGE); 88 | PCintPort::attachInterrupt(STEERING_IN_PIN, calcSteering,CHANGE); 89 | PCintPort::attachInterrupt(AUX_IN_PIN, calcAux,CHANGE); 90 | } 91 | 92 | void loop() 93 | { 94 | // create local variables to hold a local copies of the channel inputs 95 | // these are declared static so that thier values will be retained 96 | // between calls to loop. 97 | static uint16_t unThrottleIn; 98 | static uint16_t unSteeringIn; 99 | static uint16_t unAuxIn; 100 | // local copy of update flags 101 | static uint8_t bUpdateFlags; 102 | 103 | // check shared update flags to see if any channels have a new signal 104 | if(bUpdateFlagsShared) 105 | { 106 | noInterrupts(); // turn interrupts off quickly while we take local copies of the shared variables 107 | 108 | // take a local copy of which channels were updated in case we need to use this in the rest of loop 109 | bUpdateFlags = bUpdateFlagsShared; 110 | 111 | // in the current code, the shared values are always populated 112 | // so we could copy them without testing the flags 113 | // however in the future this could change, so lets 114 | // only copy when the flags tell us we can. 115 | 116 | if(bUpdateFlags & THROTTLE_FLAG) 117 | { 118 | unThrottleIn = unThrottleInShared; 119 | } 120 | 121 | if(bUpdateFlags & STEERING_FLAG) 122 | { 123 | unSteeringIn = unSteeringInShared; 124 | } 125 | 126 | if(bUpdateFlags & AUX_FLAG) 127 | { 128 | unAuxIn = unAuxInShared; 129 | } 130 | 131 | // clear shared copy of updated flags as we have already taken the updates 132 | // we still have a local copy if we need to use it in bUpdateFlags 133 | bUpdateFlagsShared = 0; 134 | 135 | interrupts(); // we have local copies of the inputs, so now we can turn interrupts back on 136 | // as soon as interrupts are back on, we can no longer use the shared copies, the interrupt 137 | // service routines own these and could update them at any time. During the update, the 138 | // shared copies may contain junk. Luckily we have our local copies to work with :-) 139 | } 140 | 141 | // do any processing from here onwards 142 | // only use the local values unAuxIn, unThrottleIn and unSteeringIn, the shared 143 | // variables unAuxInShared, unThrottleInShared, unSteeringInShared are always owned by 144 | // the interrupt routines and should not be used in loop 145 | 146 | // the following code provides simple pass through 147 | // this is a good initial test, the Arduino will pass through 148 | // receiver input as if the Arduino is not there. 149 | // This should be used to confirm the circuit and power 150 | // before attempting any custom processing in a project. 151 | 152 | // we are checking to see if the channel value has changed, this is indicated 153 | // by the flags. For the simple pass through we don't really need this check, 154 | // but for a more complex project where a new signal requires significant processing 155 | // this allows us to only calculate new values when we have new inputs, rather than 156 | // on every cycle. 157 | if(bUpdateFlags & THROTTLE_FLAG) 158 | { 159 | CRCArduinoFastServos::writeMicroseconds(SERVO_THROTTLE,unThrottleIn); 160 | } 161 | 162 | if(bUpdateFlags & STEERING_FLAG) 163 | { 164 | CRCArduinoFastServos::writeMicroseconds(SERVO_STEERING,unSteeringIn); 165 | } 166 | 167 | if(bUpdateFlags & AUX_FLAG) 168 | { 169 | CRCArduinoFastServos::writeMicroseconds(SERVO_AUX,unAuxIn); 170 | } 171 | 172 | delay(500); 173 | bUpdateFlags = 0; 174 | } 175 | 176 | 177 | // simple interrupt service routine 178 | void calcThrottle() 179 | { 180 | if(PCintPort::pinState) 181 | { 182 | unThrottleInStart = TCNT1; 183 | } 184 | else 185 | { 186 | unThrottleInShared = (TCNT1 - unThrottleInStart)>>1; 187 | bUpdateFlagsShared |= THROTTLE_FLAG; 188 | } 189 | } 190 | 191 | void calcSteering() 192 | { 193 | if(PCintPort::pinState) 194 | { 195 | unSteeringInStart = TCNT1; 196 | } 197 | else 198 | { 199 | unSteeringInShared = (TCNT1 - unSteeringInStart)>>1; 200 | 201 | bUpdateFlagsShared |= STEERING_FLAG; 202 | } 203 | } 204 | 205 | void calcAux() 206 | { 207 | if(PCintPort::pinState) 208 | { 209 | unAuxInStart = TCNT1; 210 | } 211 | else 212 | { 213 | unAuxInShared = (TCNT1 - unAuxInStart)>>1; 214 | bUpdateFlagsShared |= AUX_FLAG; } 215 | } 216 | 217 | --------------------------------------------------------------------------------