⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fec.h

📁 MANTIS是由科罗拉多大学开发的传感器网络嵌入式操作系统。 这是mantis的0.9.5版本的源码。
💻 H
字号:
//  This file is part of MANTIS OS, Operating System//  See http://mantis.cs.colorado.edu/////  Copyright (C) 2003,2004,2005 University of Colorado, Boulder////  This program is free software; you can redistribute it and/or//  modify it under the terms of the mos license (see file LICENSE)/** @file fec.h * @brief Forward Error Corretion routines * * Note: this is adapted from rscode, http://rscode.sf.net */#include "inttypes.h"#include "mos.h"/** @brief Maximum allowed number of parity bytes */#define MAXIMUM_PARITY_BYTES 64#define MAXIMUM_IMPLEMENTED_PARITY_BYTES 8/** @brief Return value if fec_decode detects no errors */#define FEC_NO_ERRORS 0/** @brief Return value if fec_decode is able to fix all errors */#define FEC_CORRECTED_ERRORS 1/** @brief Return value if fec_decode cannot fix all errors */#define FEC_UNCORRECTABLE_ERRORS 2/** @brief Initalize the fec subsystem * to the specified number of parity bytes. * @param parity_bytes Number of parity bytes to be used in FEC */void fec_init (uint8_t parity_bytes);/** @brief Return the number of parity bytes the FEC subsystem is currently using.    @return number of parity bytes */uint8_t fec_get_parity_bytes ();/** @brief Encode the parity bytes for a portion of memory * @param src Place in memory to start computing FEC parity bytes for * @param len how much memory (in bytes) to compute the FEC parity bytes for * @param parity_ptr Location in memory to store the computed parity bytes. */void fec_encode (uint8_t *src, uint8_t len, uint8_t *parity_ptr);/** @brief Use FEC to correct errors if possible * * Note: this function actually changes the passed in buffer * if it is possible to fix errors. Also note that for every * 2 parity bytes, one byte error can be fixed. * @param src location to start Forward Error Correction * @param len how much memory (in bytes) to preform FEC on * @param fec_ptr location of parity bytes. * @return one of FEC_NO_ERRORS, FEC_CORRECTED_ERRORS, FEC_UNCORRECTABLE_ERRORS */uint8_t fec_decode (uint8_t *src, uint8_t len, uint8_t *fec_ptr);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -