📄 how_to_do_variable_length_queue.c
字号:
/** * Good variant of net frame generation task because * thereis no need to have big buffer if the speed of net is low * it saves a lot of RAM * How implement this thing? */#define some_time RATE_MS/NET_SPEED_CHARS_PER_SECvoid Frame_Generation_task (){int bufer_size;int char_to_transmit;int crc; while (1 == 1) { bufer_size = xQueuRecive (Net_Queue,char_to_transmit,some_time); send_to_the_net_media (SOME_NETWORK_ADRESS_OF_SENDER); crc = SOME_NETWORK_ADRESS_OF_SENDER while ( (bufer_size != 0) && xQueuRecive (Net_Queue,char_to_transmit,some_time) ) { send_to_the_net_media (char_to_transmit); crc = crc + char_to_transmit; }; send_to_the_net_media (crc); }}/** * BUT THEREIS A PROBLEM if TWO TASK WANTS TO SEND SOME INFORMATION */ void task
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -