当前位置:网站首页>22. Realization of message processing task
22. Realization of message processing task
2022-07-28 15:34:00 【Turing_ three hundred and twenty-one】
\qquad Here is HD-GR GNSS Message processing task implementation code of navigation software :
// main_message.c -- Navigation message processing task.
/* * Copyright (C) 2005 Andrew Greenberg * Distributed under the GNU GENERAL PUBLIC LICENSE (GPL) Version 2 (June 1991). * See the "COPYING" file distributed with this software for more information. */
/* Namuru GPS receiver project * Original : message.c * Mods : driving LED part has commented/replaced for Namuru HW * version : V1.1 * date : 8/7/2008 */
/* * HD-GR GNSS receiver project * Modes : Inherited the code of message.c in the Namuru GPS receiver project * V1.0 and made necessary adjustments to adapt to the new RTOS and * functions. * version : V1.0 * date : xx/xx/2015 */
#include <io.h>
#include <stdio.h>
#include <math.h>
#include "includes.h"
#include "system.h"
#include "altera_avalon_pio_regs.h"
#include "alt_types.h"
#include "sys/alt_irq.h"
#include "gps_message.h"
#include "b1i_message.h"
#include "main_ephemeris.h"
#include "main_position.h"
/****************************************************************************** * Defines ******************************************************************************/
/****************************************************************************** * Globals ******************************************************************************/
OS_FLAG_GRP *m_MessageFlag __attribute__ ((section(".isrdata.rwdata")));
OS_FLAGS channels_with_subframes __attribute__ ((section(".isrdata.rwdata")));
/****************************************************************************** * Statics ******************************************************************************/
/****************************************************************************** * Stuff incoming bits from the accum_task into words and subframes in * the messages structure. ******************************************************************************/
void message_task(void* pdata) // input 'pdata' not used
{
INT8U err;
OS_FLAGS channels_with_bits, channel_bits;
// There's no way that we're going to get a bit before this thread
// is first executed, so it's ok to run the flag init here.
m_MessageFlag = OSFlagCreate((OS_FLAGS)0, &err);
while (1) {
// Block if there are no channels with bits ready. Wake up if any bits
// from the 20 channels (0xFFFFF) are set. Clear the flag on wakeup,
// with the bits saved in channels_with_bits.
channels_with_bits = OSFlagPend(m_MessageFlag,
(1 << TOT_MAX_CHANNELS) - 1,
OS_FLAG_WAIT_SET_ANY + OS_FLAG_CONSUME,
0, &err);
// OK we're awake, process the messages
GNSS_ENTER_CRITICAL();
channel_bits = g_channel_bits;
GNSS_EXIT_CRITICAL();
// led_turnon(LED3);
// Clear the flag IPC shadow (see below)
channels_with_subframes = 0;
if (m_sys_posconst & POS_CONSTELL_BDS) {
b1i_process_message(channels_with_bits >> GPS_MAX_CHANNELS,
channel_bits >> GPS_MAX_CHANNELS);
channels_with_subframes <<= GPS_MAX_CHANNELS;
}
if (m_sys_posconst & POS_CONSTELL_GPS) {
gps_process_message(channels_with_bits, channel_bits);
}
// Wake up the ephemeris thread if there are subframes ready
if (channels_with_subframes) {
OSFlagPost(m_EphemerisChannelFlag, channels_with_subframes, OS_FLAG_SET, &err);
}
// led_turnoff(LED3);
}
}
边栏推荐
- Crmeb Standard Version window+phpstudy8 installation tutorial (I)
- Template injection summary
- Qt创建文件夹的两种方式区别
- Opencv - cut out mask foreground area from grayscale image
- Qt信号与槽的五种连接方式
- Data synchronization of new version
- [jspwiki]jspwiki installation deployment and configuration
- 2、开源GPS项目HD-GR GNSS的自叙
- Leetcode - sliding window extremum, search tree postorder traversal, statistical difference pairs, dividing equal subsets
- Opencv - draw mask images of multiple instances
猜你喜欢

Multi merchant mall system with relatively clean code

sql语句的执行流程

Opencv - closely combine multiple irregular small graphs into large graphs

NFTScan 与 NFTPlay 在 NFT 数据领域达成战略合作

爆肝整理 JVM 十大模块知识点总结,不信你还不懂

Voltage relay dy-28c

游戏测试的概念是什么?测试方法和流程有哪些?

Tencent interview -- please design a thread pool to implement sequential execution
![[leetcode] 35. Search the insertion position](/img/cd/bd6f5152be098072b3a43a456e4c99.png)
[leetcode] 35. Search the insertion position

基于RSocket协议实现客户端与服务端通信
随机推荐
.net core version 2.2 cross domain configuration
程序员的自我修养
提速1200倍!MIT开发新一代药物研发AI,吊打老模型
day 7/12
文件及目录操作(5)
根据输入target,返回数组的两个下标。
Compilation learning
Understand crmeb open source online education knowledge payment system
封装统一返回对象MessageResult
2、开源GPS项目HD-GR GNSS的自叙
Editor in ArcGIS Pro
ArcGIS Pro 中的编辑器
一篇文章了解RSocket协议
Jds-12 time relay
Customer service system attached to crmeb Standard Edition
CANoe使用教程
Explain the difference set, intersection set and union set of complex type set in detail.Net
What are the functions to be added in crmeb pro2.2?
Grpc protocol buffer
【通道注意力机制】SENet