From 946f9fc6031df59fc681f957cabc04841a488ede Mon Sep 17 00:00:00 2001 From: redPanther Date: Wed, 13 Jul 2016 16:19:19 +0200 Subject: [PATCH] compile fix (#114) * multi fix commit - refactoring leddevicefactory - adalight: default for "delayAfterConnect" is 1s now - needed for most arduino's because of there special behaviour on open - fadecandy: new option for disabling configuration send - if you want to keep your fadecandy defaults - Hyperion.cpp: simplify createSmoothing discussed in #105 - smoothing: -- add option for continuous output -- when updatedelay>0 and continousOutput is disabled, buffer is flushed correctly after no input is detected * add doxygen to travis * fix code * fix compile fir ws281x pwm * remove git merge stuff * fix compile --- libsrc/leddevice/LedDeviceFactory.cpp | 16 ++++++++-------- libsrc/leddevice/LedDeviceWS2812b.cpp | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/libsrc/leddevice/LedDeviceFactory.cpp b/libsrc/leddevice/LedDeviceFactory.cpp index fc3e4457..60a8085f 100755 --- a/libsrc/leddevice/LedDeviceFactory.cpp +++ b/libsrc/leddevice/LedDeviceFactory.cpp @@ -296,14 +296,14 @@ LedDevice * LedDeviceFactory::construct(const Json::Value & deviceConfig) else if (type == "ws281x") { device = new LedDeviceWS281x( - deviceConfig.get("gpio", 18).asInt(); - leds = deviceConfig.get("leds", 256).asInt(); - freq = deviceConfig.get("freq", (Json::UInt)800000ul).asInt(); - dmanum = deviceConfig.get("dmanum", 5).asInt(); - deviceConfig.get("pwmchannel", 0).asInt(); - deviceConfig.get("invert", 0).asInt(); - deviceConfig.get("rgbw", 0).asInt(); - whiteAlgorithm = deviceConfig.get("white_algorithm","").asString(); + deviceConfig.get("gpio", 18).asInt(), + deviceConfig.get("leds", 256).asInt(), + deviceConfig.get("freq", (Json::UInt)800000ul).asInt(), + deviceConfig.get("dmanum", 5).asInt(), + deviceConfig.get("pwmchannel", 0).asInt(), + deviceConfig.get("invert", 0).asInt(), + deviceConfig.get("rgbw", 0).asInt(), + deviceConfig.get("white_algorithm","").asString() ); } #endif diff --git a/libsrc/leddevice/LedDeviceWS2812b.cpp b/libsrc/leddevice/LedDeviceWS2812b.cpp index 0fff95d6..4840a054 100644 --- a/libsrc/leddevice/LedDeviceWS2812b.cpp +++ b/libsrc/leddevice/LedDeviceWS2812b.cpp @@ -582,7 +582,7 @@ unsigned int LedDeviceWS2812b::mem_phys_to_virt(uint32_t phys) // Map a peripheral's IO memory into our virtual memory, so we can read/write it directly void * LedDeviceWS2812b::map_peripheral(uint32_t base, uint32_t len) { - int fd = open("/dev/mem", O_RDWR); + int fd = ::open("/dev/mem", O_RDWR); void * vaddr; if (fd < 0) @@ -691,7 +691,7 @@ void LedDeviceWS2812b::initHardware() // Use /proc/self/pagemap to figure out the mapping between virtual and physical addresses pid = getpid(); sprintf(pagemap_fn, "/proc/%d/pagemap", pid); - fd = open(pagemap_fn, O_RDONLY); + fd = ::open(pagemap_fn, O_RDONLY); if (fd < 0) { @@ -704,7 +704,7 @@ void LedDeviceWS2812b::initHardware() fatal("Failed to seek on %s: %m\n", pagemap_fn); } - printf("Page map: %d pages\n", NUM_PAGES); + printf("Page map: %i pages\n", (int)NUM_PAGES); for (unsigned int i = 0; i < NUM_PAGES; i++) { uint64_t pfn;