Hello
I need to know what this snippet of the following code exactly does.
Also, please do tell me what does PCintPort and the doublle colon (:
mean in an arduino code.
Thank You for your help.
#define RX_PINS_OFFSET 2
#define PIN_RX_THROTTLE 4
volatile int pwm_start_time[4];
uint8_t latest_interrupted_pin;
void initialize()
{
pinMode(PIN_RX_THROTTLE, INPUT); digitalWrite(PIN_RX_THROTTLE, HIGH);
PCintPort::attachInterrupt(PIN_RX_THROTTLE, &rising, RISING);
}
void rising()
{
latest_interrupted_pin=PCintPort::arduinoPin;
PCintPort::attachInterrupt(latest_interrupted_pin, &falling, FALLING);
pwm_start_time[latest_interrupted_pin-RX_PINS_OFFSET] = micros();
}
void falling() {
latest_interrupted_pin=PCintPort::arduinoPin;
PCintPort::attachInterrupt(latest_interrupted_pin, &rising, RISING);
rx_values[latest_interrupted_pin-RX_PINS_OFFSET] = micros()-pwm_start_time[latest_interrupted_pin-RX_PINS_OFFSET];
}