Skip to content

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

Open
riktw wants to merge 3 commits into
enjoy-digital:masterfrom
riktw:master
Open

Adding a weak isr handler to handle non uart interrupts#1735
riktw wants to merge 3 commits into
enjoy-digital:masterfrom
riktw:master

Conversation

@riktw
Copy link
Copy Markdown
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
Copy Markdown

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