Commit 96963d8
committed
analogReference: fix heap corruption
on startup, analogReference() is being called to read the real value of 5V voltage so there's a way to retrieve the real voltage via analogRead().
However, calling R_ADC_Close when the ADC is not yet open triggers a chain of events that ends up at
__STATIC_INLINE void R_FSP_IsrContextSet (IRQn_Type const irq, void * p_context)
{
gp_renesas_isr_context[irq] = p_context;
}
If the irq is not initialized, setting gp_renesas_isr_context[somethig] will overwrite random memory.
Fixes #761 parent 44e51bd commit 96963d8
1 file changed
+12
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
545 | 545 | | |
546 | 546 | | |
547 | 547 | | |
548 | | - | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
549 | 551 | | |
550 | 552 | | |
551 | 553 | | |
552 | | - | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
553 | 557 | | |
554 | 558 | | |
555 | 559 | | |
| |||
638 | 642 | | |
639 | 643 | | |
640 | 644 | | |
641 | | - | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
642 | 648 | | |
643 | 649 | | |
644 | 650 | | |
645 | 651 | | |
646 | 652 | | |
647 | | - | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
648 | 656 | | |
649 | 657 | | |
650 | 658 | | |
| |||
0 commit comments