Pārlūkot izejas kodu

device: use CROWN_CAN_RELOAD

Daniele Bartolini 1 gadu atpakaļ
vecāks
revīzija
8c11ec67c2
2 mainītis faili ar 6 papildinājumiem un 2 dzēšanām
  1. 2 0
      src/config.h
  2. 4 2
      src/device/device.cpp

+ 2 - 0
src/config.h

@@ -27,6 +27,8 @@
 	&& (CROWN_PLATFORM_LINUX || CROWN_PLATFORM_WINDOWS)       \
 	? 1 : 0)
 
+#define CROWN_CAN_RELOAD (CROWN_DEBUG || CROWN_DEVELOPMENT)
+
 #ifndef CROWN_BUILD_UNIT_TESTS
 	#define CROWN_BUILD_UNIT_TESTS 1
 #endif

+ 4 - 2
src/device/device.cpp

@@ -854,7 +854,7 @@ void Device::destroy_resource_package(ResourcePackage &rp)
 
 void Device::refresh(const char *json)
 {
-#if CROWN_DEBUG
+#if CROWN_CAN_RELOAD
 	TempAllocator4096 ta;
 	JsonObject obj(ta);
 	JsonArray list(ta);
@@ -887,7 +887,9 @@ void Device::refresh(const char *json)
 
 	if (_paused)
 		unpause();
-#endif // if CROWN_DEBUG
+#else
+	CE_UNUSED(json);
+#endif // if CROWN_CAN_RELOAD
 }
 
 void Device::screenshot(const char *path)