Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: ComparatorIn_demo TEMT6200_demo 05_comparator_demo 05_comparator_demo ... more
Revision 19:e6a4cd28e217, committed 2013-08-25
- Comitter:
- frankvnk
- Date:
- Sun Aug 25 18:00:42 2013 +0000
- Parent:
- 18:efa8d41b738f
- Commit message:
- _fptr names were too generic. Added comparatorin_ to each name.
Changed in this revision
| ComparatorIn.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/ComparatorIn.cpp Sat Jul 20 18:56:26 2013 +0000
+++ b/ComparatorIn.cpp Sun Aug 25 18:00:42 2013 +0000
@@ -9,9 +9,9 @@
#include "ComparatorIn.h"
-void (*rise_fptr)(void); // Pointer to user function - called after rising IRQ assertion.
-void (*fall_fptr)(void); // Pointer to user function - called after falling IRQ assertion.
-AnalogOut *_dac12; // Pointer to AnalogOut
+void (*comparatorin_rise_fptr)(void); // Pointer to user function - called after rising IRQ assertion.
+void (*comparatorin_fall_fptr)(void); // Pointer to user function - called after falling IRQ assertion.
+AnalogOut *_dac12; // Pointer to AnalogOut
const PinMap ComparatorIn::PinMap_CMP[] = {
{PTC6, CMP0_IN0, 0},
@@ -26,8 +26,8 @@
ComparatorIn::ComparatorIn(PinName pinP, PinName pinM)
{
- rise_fptr = NULL;
- fall_fptr = NULL;
+ comparatorin_rise_fptr = NULL;
+ comparatorin_fall_fptr = NULL;
CMPnumberP = (CMPName)pinmap_peripheral(pinP, PinMap_CMP);
if (CMPnumberP == (uint32_t)NC) // When NC, use DAC0
CMPnumberP = 0x07;
@@ -218,12 +218,12 @@
{
CMP0->SCR &= ~CMP_SCR_IER_MASK; // Disable rising int.
CMP0->SCR |= CMP_SCR_CFR_MASK; // clear flag
- if(fall_fptr == NULL)
+ if(comparatorin_fall_fptr == NULL)
NVIC_DisableIRQ(CMP0_IRQn);
}
else
{
- rise_fptr = fptr;
+ comparatorin_rise_fptr = fptr;
CMP0->SCR |= (CMP_SCR_IER_MASK | CMP_SCR_CFR_MASK); // Enable rising int. and clear flag
NVIC_EnableIRQ(CMP0_IRQn); // enable CMP0 interrupt
}
@@ -235,12 +235,12 @@
{
CMP0->SCR &= ~CMP_SCR_IEF_MASK; // Disable falling int.
CMP0->SCR |= CMP_SCR_CFF_MASK; // clear flag
- if(rise_fptr == NULL)
+ if(comparatorin_rise_fptr == NULL)
NVIC_DisableIRQ(CMP0_IRQn);
}
else
{
- fall_fptr = fptr;
+ comparatorin_fall_fptr = fptr;
CMP0->SCR |= (CMP_SCR_IEF_MASK | CMP_SCR_CFF_MASK); // Enable falling int. and clear flag
NVIC_EnableIRQ(CMP0_IRQn); // enable CMP0 interrupt
}
@@ -252,15 +252,15 @@
// Rising edge
if (((CMP0->SCR & CMP_SCR_IER_MASK)==CMP_SCR_IER_MASK) && ((CMP0->SCR & CMP_SCR_CFR_MASK)==CMP_SCR_CFR_MASK))
{
- CMP0->SCR |= CMP_SCR_CFR_MASK; // Clear the flag
- if (rise_fptr != NULL) rise_fptr(); // call user function
+ CMP0->SCR |= CMP_SCR_CFR_MASK; // Clear the flag
+ if (comparatorin_rise_fptr != NULL) comparatorin_rise_fptr(); // call user function
}
// Falling edge
if (((CMP0->SCR & CMP_SCR_IEF_MASK)==CMP_SCR_IEF_MASK) && ((CMP0->SCR & CMP_SCR_CFF_MASK)==CMP_SCR_CFF_MASK))
{
- CMP0->SCR |= CMP_SCR_CFF_MASK; // Clear the flag
- if (fall_fptr != NULL) fall_fptr(); // call user function
+ CMP0->SCR |= CMP_SCR_CFF_MASK; // Clear the flag
+ if (comparatorin_fall_fptr != NULL) comparatorin_fall_fptr(); // call user function
}
}