Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DIO 5ch TTL a
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
6
Issues
6
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
FMC DIO 5ch TTL a
Commits
12ee3842
Commit
12ee3842
authored
Nov 19, 2020
by
Jorge Machado
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dio_extension' of
https://ohwr.org/project/fmc-dio-5chttla
into dio_extension
parents
52511df5
9b8d2bab
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
8 deletions
+20
-8
file-log.c
sw/irq-demo/dep/file-log.c
+11
-5
fmc-dio-device.c
sw/irq-demo/dep/fmc-dio-device.c
+6
-0
irq-demo.c
sw/irq-demo/irq-demo.c
+3
-3
No files found.
sw/irq-demo/dep/file-log.c
View file @
12ee3842
...
...
@@ -47,8 +47,10 @@ static void send_to_file_log_device(log_device dev, const char *msg)
if
(
!
check_file_log_priv
(
dev
))
{
priv
=
get_private_info
(
dev
);
fputs
(
msg
,
priv
->
fp
);
fputs
(
"
\n
"
,
priv
->
fp
);
if
(
priv
&&
priv
->
fp
)
{
fputs
(
msg
,
priv
->
fp
);
fputs
(
"
\n
"
,
priv
->
fp
);
}
}
}
...
...
@@ -56,10 +58,14 @@ static void deinit_file_log_device(log_device dev)
{
struct
file_log_private
*
priv
;
if
(
dev
->
private
)
{
if
(
!
check_file_log_priv
(
dev
)
)
{
priv
=
get_private_info
(
dev
);
fclose
(
priv
->
fp
);
free
(
dev
->
private
);
if
(
priv
)
{
if
(
priv
->
fp
)
{
fclose
(
priv
->
fp
);
}
free
(
priv
);
}
}
}
...
...
sw/irq-demo/dep/fmc-dio-device.c
View file @
12ee3842
...
...
@@ -26,6 +26,8 @@
#include "fmc-dio-device.h"
#include "fmc-dio-device-private.h"
#define FMC_DIO_FLUSH_SLEEP 5
fmc_dio_device
create_fmc_dio_device
(
char
*
name
)
{
fmc_dio_device
dev
=
calloc
(
1
,
sizeof
(
*
dev
));
...
...
@@ -298,10 +300,14 @@ void flush_fmc_dio_device_channel(fmc_dio_device dev, int ch)
struct
usr_timestamp
*
ts
;
unsigned
int
nts
;
LOG
(
dev
,
"Flushing FMC DIO device, channel %d... "
,
ch
);
sleep
(
FMC_DIO_FLUSH_SLEEP
);
ret
=
get_hw_ts_from_fmc_dio_device
(
dev
,
ch
,
&
ts
,
&
nts
);
if
(
ret
==
0
)
{
free
(
ts
);
}
LOG
(
dev
,
"Ok!
\n
"
);
}
static
int
get_kernel_leaps_info
(
fmc_dio_device
dev
)
...
...
sw/irq-demo/irq-demo.c
View file @
12ee3842
...
...
@@ -121,13 +121,13 @@ int main(int argc, char *argv[])
/* Before starting IRQ demo, Interrupts should be properly configured:
* 1) Disable all interrupts
* 2)
Flush TEST_FMC_DIO_CH channel
* 3)
Enable the TEST_FMC_DIO_CH interrupt line
* 2)
Enable the TEST_FMC_DIO_CH interrupt line
* 3)
Flush TEST_FMC_DIO_CH channel
* 4) Setup specific information for interrupt line (period from user arguments or default one)
*/
disable_fmc_dio_device_all_irq
(
dev
);
flush_fmc_dio_device_channel
(
dev
,
TEST_FMC_DIO_CH
);
enable_fmc_dio_device_irq
(
dev
,
TEST_FMC_DIO_CH
);
flush_fmc_dio_device_channel
(
dev
,
TEST_FMC_DIO_CH
);
setup_fmc_dio_device_irq
(
dev
,
user_arguments
->
irq_period
,
TEST_FMC_DIO_COUNT
);
/* Configure stdin as non-blocking. It is required for the user check exit function */
...
...
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