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;