Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CH32X035 how to work #511

Open
vuhazu opened this issue Jun 1, 2024 · 1 comment
Open

CH32X035 how to work #511

vuhazu opened this issue Jun 1, 2024 · 1 comment

Comments

@vuhazu
Copy link

vuhazu commented Jun 1, 2024

i change interrupt function, build ok, but not working

void RCSwitch::enableReceive() {
if (this->nReceiverInterrupt != -1) {
RCSwitch::nReceivedValue = 0;
RCSwitch::nReceivedBitlength = 0;
#if defined(RaspberryPi) // Raspberry Pi
wiringPiISR(this->nReceiverInterrupt, INT_EDGE_BOTH, &handleInterrupt);
#elif defined(CH32X035) // CH32x035
attachInterrupt(this->nReceiverInterrupt,GPIO_Mode_IPU, handleInterrupt, EXTI_Mode_Interrupt, EXTI_Trigger_Rising_Falling );
#else // ARDUINO
attachInterrupt(this->nReceiverInterrupt, handleInterrupt, CHANGE);
#endif
}
}

@vuhazu
Copy link
Author

vuhazu commented Jun 1, 2024

CH32X035 interrupt function

void attachInterrupt(uint32_t pin,GPIOMode_TypeDef io_mode, void (*callback)(void), EXTIMode_TypeDef it_mode, EXTITrigger_TypeDef trigger_mode);
void detachInterrupt(uint32_t pin);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant