X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fhardware%2Fzeroplus-logic-cube%2Fprotocol.c;h=6e0e96149711ce0f4d4d8e96c9212c518efd54b0;hb=43376f3324cddd257a0260b06d9db8180c35fdf3;hp=ce20ccf4012f1a5fadd9098b82ef32e10b0a8c50;hpb=155b680da482cea2381becb73c51cfb838bff31e;p=libsigrok.git
diff --git a/src/hardware/zeroplus-logic-cube/protocol.c b/src/hardware/zeroplus-logic-cube/protocol.c
index ce20ccf4..6e0e9614 100644
--- a/src/hardware/zeroplus-logic-cube/protocol.c
+++ b/src/hardware/zeroplus-logic-cube/protocol.c
@@ -17,13 +17,14 @@
* along with this program. If not, see .
*/
+#include
#include
#include "protocol.h"
SR_PRIV unsigned int get_memory_size(int type)
{
if (type == MEMORY_SIZE_8K)
- return 8 * 1024;
+ return (8 * 1024);
else if (type <= MEMORY_SIZE_8M)
return (32 * 1024) << type;
else
@@ -63,9 +64,9 @@ SR_PRIV int set_limit_samples(struct dev_context *devc, uint64_t samples)
devc->limit_samples = samples;
- if (samples <= 2 * 1024)
+ if (samples <= (2 * 1024))
devc->memory_size = MEMORY_SIZE_8K;
- else if (samples <= 16 * 1024)
+ else if (samples <= (16 * 1024))
devc->memory_size = MEMORY_SIZE_64K;
else
devc->memory_size = 19 - clz(samples - 1);