小编Mlo*_*der的帖子

Contiki rtos中的“产量”是什么意思

我正在使用 contiki 并试图理解其中使用的术语。我在互联网上到处观察某些词,例如 yield、stackless。一些例子

PROCESS_EVENT_CONTINUE : This event is sent by the kernel to a process that is waiting in a PROCESS_YIELD() statement.
PROCESS_YIELD(); // Wait for any event, equivalent to PROCESS_WAIT_EVENT().
PROCESS_WAIT_UNTIL(); // Wait for a given condition; may not yield the process.
Run Code Online (Sandbox Code Playgroud)

产生一个进程是否意味着在 contiki 中执行一个进程。contiki 是无堆栈的又是什么意思。

rtos process contiki contiki-process

2
推荐指数
1
解决办法
2773
查看次数

这个C程序的输出我无法理解

我正在修改C并正在制作一些测试程序.在一个程序中,我正在检查一个正在翻译这种情况的条件.

#include <stdio.h>
int main()
{
if(0 <= 3000.000000 <= 2000.00){  //this is the condition
printf("3000 is less than 2000, whoa.. \n");
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)

输出始终是此打印字符串.我不明白为什么.

PS

我正在测试中间值,即3000.000000,但它可以是一些变量.

c

-2
推荐指数
1
解决办法
69
查看次数

使用#defines时,我得到的结果不同

我正在一个项目中工作,我们有很多内存作为#defines,如

#define SRAM1      0xb0000000+((1024*1024)-64)   //1
Run Code Online (Sandbox Code Playgroud)

如果我使用上面的#define我会收到错误如果我将其更改为

#define SRAM1     (0xb0000000+((1024*1024)-64))  //2
Run Code Online (Sandbox Code Playgroud)

有用.即便如此

#define SRAM1      0xb0000000+((1048576)-64)     //3
Run Code Online (Sandbox Code Playgroud)

是否存在关联性的问题或指针中的乘法以这种方式不允许?我们工作中的PS用法是

         if((*(OSLongType *)(SRAM1)) == 1)
Run Code Online (Sandbox Code Playgroud)

要么

         *(OSLongType *)(SRAM1)= 0;
Run Code Online (Sandbox Code Playgroud)

通过这种方式.

c

-2
推荐指数
1
解决办法
57
查看次数

标签 统计

c ×2

contiki ×1

contiki-process ×1

process ×1

rtos ×1