Commit 95e8ba67 authored by Alessandro Rubini's avatar Alessandro Rubini

userspace/include/fpga_io.h: bugfix in #define

pps_gen.c had a missing semicolon because of this bug. Fix the
macro to behave properly withing if/else. And fix the user, adding
the missing semicolon.

We all know that these two functions should be static inline, and the
fpga base pointer should be void *, but that's for later.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent ef3ed69f
...@@ -37,7 +37,9 @@ extern volatile uint8_t *_fpga_base_virt; /* libwr/fpga_io.c */ ...@@ -37,7 +37,9 @@ extern volatile uint8_t *_fpga_base_virt; /* libwr/fpga_io.c */
#define FPGA_BASE_ADDR _fpga_base_virt #define FPGA_BASE_ADDR _fpga_base_virt
#define _fpga_writel(reg, val){ *(volatile uint32_t *)(FPGA_BASE_ADDR + (reg)) = (val); } #define _fpga_writel(reg, val) \
#define _fpga_readl(reg) (*(volatile uint32_t *)(FPGA_BASE_ADDR + (reg))) (*(volatile uint32_t *)(FPGA_BASE_ADDR + (reg)) = (val))
#define _fpga_readl(reg) \
(*(volatile uint32_t *)(FPGA_BASE_ADDR + (reg)))
#endif #endif
...@@ -79,7 +79,7 @@ int shw_pps_gen_enable_output(int enable) ...@@ -79,7 +79,7 @@ int shw_pps_gen_enable_output(int enable)
{ {
uint32_t escr = ppsg_read(ESCR); uint32_t escr = ppsg_read(ESCR);
if (enable) if (enable)
ppsg_write(ESCR, escr | PPSG_ESCR_PPS_VALID) ppsg_write(ESCR, escr | PPSG_ESCR_PPS_VALID);
else else
ppsg_write(ESCR, escr & ~PPSG_ESCR_PPS_VALID); ppsg_write(ESCR, escr & ~PPSG_ESCR_PPS_VALID);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment