Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
card10
firmware
Commits
9cbff5a1
Commit
9cbff5a1
authored
May 07, 2019
by
schneider
Browse files
fix(testapp): Initialize ecg interrupt before the ecg chip
parent
40fb232f
Changes
1
Hide whitespace changes
Inline
Side-by-side
testapp/main.c
View file @
9cbff5a1
...
...
@@ -290,6 +290,14 @@ int main(void)
// Enable 32 kHz output
RTC_SquareWave
(
MXC_RTC
,
SQUARE_WAVE_ENABLED
,
F_32KHZ
,
NOISE_IMMUNE_MODE
,
NULL
);
const
gpio_cfg_t
interrupt_pin
=
{
PORT_1
,
PIN_12
,
GPIO_FUNC_IN
,
GPIO_PAD_PULL_UP
};
GPIO_Config
(
&
interrupt_pin
);
GPIO_RegisterCallback
(
&
interrupt_pin
,
ecgFIFO_callback
,
NULL
);
GPIO_IntConfig
(
&
interrupt_pin
,
GPIO_INT_EDGE
,
GPIO_INT_FALLING
);
GPIO_IntEnable
(
&
interrupt_pin
);
NVIC_EnableIRQ
(
MXC_GPIO_GET_IRQ
(
PORT_1
));
// Enable SPI
sys_cfg_spi_t
spi17y_master_cfg
;
...
...
@@ -325,19 +333,12 @@ int main(void)
const
int
FIFO_FAST_SAMPLE_MASK
=
0x1
;
const
int
ETAG_BITS_MASK
=
0x7
;
const
gpio_cfg_t
interrupt_pin
=
{
PORT_1
,
PIN_12
,
GPIO_FUNC_IN
,
GPIO_PAD_PULL_UP
};
GPIO_Config
(
&
interrupt_pin
);
GPIO_RegisterCallback
(
&
interrupt_pin
,
ecgFIFO_callback
,
NULL
);
GPIO_IntConfig
(
&
interrupt_pin
,
GPIO_INT_EDGE
,
GPIO_INT_FALLING
);
GPIO_IntEnable
(
&
interrupt_pin
);
NVIC_EnableIRQ
(
MXC_GPIO_GET_IRQ
(
PORT_1
));
while
(
1
)
{
#if 1
// Read back ECG samples from the FIFO
if
(
ecgFIFOIntFlag
||
GPIO_InGet
(
&
interrupt_pin
)
==
0
)
{
if
(
ecgFIFOIntFlag
)
{
ecgFIFOIntFlag
=
false
;
//printf("Int\n");
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment