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

Adding a weak isr handler to handle non uart interrupts #1735

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

riktw
Copy link
Contributor

@riktw riktw commented Jul 26, 2023

This would add a weak isr_handler that can be overridden in a user's application to handle interrupts that are not for the build in uart. This would make it possible to use the libbase for your own application and add peripherals with an irq.

For example, in an own application something like this can be added to handle an interrupt from an additional timer:

unsigned int isr_handler(int irqs)
{	
	unsigned int irqHandled = 0;
	if(irqs & (1 << TIMER2_INTERRUPT))
	{
		Timer2ClearPendingInterrupt();
		// Some own function to act on a timer interrupt
		irqHandled = 1;
	}
	return irqHandled;
}

@hvegh
Copy link

hvegh commented Oct 25, 2023

Would like to see something like this to be added, please have a look.

This closes #1807

Tnx

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

Successfully merging this pull request may close these issues.

2 participants