当前位置:网站首页>22、电文处理任务实现
22、电文处理任务实现
2022-07-28 14:26:00 【Turing_321】
\qquad 下面是HD-GR GNSS导航软件的电文处理任务实现代码:
// 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);
}
}
边栏推荐
- Summary of common redis commands (self provided)
- GRC concept GRC architecture RPC lifecycle
- volatile原理
- Repvgg paper explanation and model reproduction using pytoch
- Grpc protocol buffer
- Drawing method using GL under URP
- day 7/12
- 听说crmeb多商户增加了种草功能?
- How to write a JMeter script common to the test team
- crmeb v4.3部署流程
猜你喜欢

Celery related

代码比较干净的多商户商城系统

Crmeb v4.3 deployment process

Pyinstaller packages py as an EXE file

Principle and configuration of MPLS LDP

How to set some app application icons on the iPhone Apple phone that you don't want others to see? How to hide the app application settings on the mobile desktop so that they can be used normally afte

流畅到让人头皮发麻的单商户商城,你用过吗?

crmeb 标准版window+phpstudy8安装教程(二)

DJ-131/60C电压继电器

shellcode编写学习-环境
随机推荐
2021-06-29
汇编学习
3438. Number system conversion
In 2022, the average salary of global programmers was released, and China ranked unexpectedly
PMP practice once a day | don't get lost in the exam -7.28 (including agility + multiple choices)
7/13(水塘抽样)
Jy-7ga/1 voltage relay
Jwy-32b voltage relay
For loop
分享一下一二线大厂HR面经分享
R introduction example details
Understand crmeb open source online education knowledge payment system
[jspwiki]jspwiki installation deployment and configuration
svg 验证码识别体验
crmeb知识付费手动安装教程
ERROR:bokeh.core.validation.check:E-1001 (BAD_COLUMN_NAME)
SRTT-110VDC-4H-C时间继电器
听说crmeb多商户增加了种草功能?
I heard that many merchants of crmeb have added the function of planting grass?
crmeb标准版附带的客服系统