mirror of
https://github.com/nasa/fpp.git
synced 2025-12-10 15:36:19 -06:00
Remove FpConfig include, fix PRI underscores
This commit is contained in:
parent
865e9aa3f3
commit
1035a25ad4
@ -90,7 +90,7 @@ trait UseAnalyzer extends TypeExpressionAnalyzer {
|
||||
case direct : Ast.SpecConnectionGraph.Direct => visitList(a, direct.connections, connection)
|
||||
case pattern : Ast.SpecConnectionGraph.Pattern => for {
|
||||
a <- qualIdentNode (componentInstanceUse) (a, pattern.source)
|
||||
a <- visitList(a, pattern.targets, qualIdentNode (componentInstanceUse) _)
|
||||
a <- visitList(a, pattern.targets, qualIdentNode(componentInstanceUse))
|
||||
} yield a
|
||||
}
|
||||
}
|
||||
|
||||
@ -120,27 +120,16 @@ case class AliasCppWriter (
|
||||
return linesMember(List())
|
||||
}
|
||||
|
||||
val systemHHeaders = List(
|
||||
"FpConfig.h"
|
||||
).map(CppWriter.systemHeaderString).map(line)
|
||||
|
||||
val standardHeaders = List(
|
||||
"Fw/Types/BasicTypes.h",
|
||||
).map(CppWriter.headerString)
|
||||
|
||||
val symbolHeaders = writeHIncludeDirectives(s, aNode)
|
||||
val headers = (standardHeaders ++ symbolHeaders).distinct.sorted.map(line)
|
||||
linesMember(List.concat(
|
||||
addBlankPrefix(systemHHeaders),
|
||||
addBlankPrefix(headers)
|
||||
))
|
||||
linesMember(addBlankPrefix(headers))
|
||||
}
|
||||
|
||||
private def getHppIncludes: CppDoc.Member.Lines = {
|
||||
val systemHppHeaders = List(
|
||||
"FpConfig.hpp"
|
||||
).map(CppWriter.systemHeaderString).map(line)
|
||||
|
||||
val standardHeaders = List(
|
||||
aliasType.aliasType match {
|
||||
case Type.String(_) => "Fw/Types/String.hpp"
|
||||
@ -149,10 +138,7 @@ case class AliasCppWriter (
|
||||
).map(CppWriter.headerString)
|
||||
val symbolHeaders = writeHppIncludeDirectives(s, aNode)
|
||||
val headers = standardHeaders ++ symbolHeaders
|
||||
linesMember(List.concat(
|
||||
addBlankPrefix(systemHppHeaders),
|
||||
addBlankPrefix(headers.distinct.sorted.map(line))
|
||||
))
|
||||
linesMember(addBlankPrefix(headers.distinct.sorted.map(line)))
|
||||
}
|
||||
|
||||
private def getHppDefinition: CppDoc.Member.Lines = {
|
||||
@ -182,7 +168,7 @@ case class AliasCppWriter (
|
||||
ty match {
|
||||
case Type.Float(f) => aliasType.aliasType.toString().toLowerCase()
|
||||
case Type.PrimitiveInt(i) => aliasType.aliasType.toString().toLowerCase()
|
||||
case _ => typeCppWriter.write(ty)
|
||||
case _ => "_" + typeCppWriter.write(ty)
|
||||
}
|
||||
}
|
||||
|
||||
@ -191,7 +177,7 @@ case class AliasCppWriter (
|
||||
linesMember(addBlankPrefix(
|
||||
AnnotationCppWriter.writePreComment(aNode) ++ lines(
|
||||
s"""|typedef ${typeCppWriter.write(aliasType.aliasType)} $name;
|
||||
|#define PRI_$name PRI_${fmtSpec}""")
|
||||
|#define PRI_$name PRI${fmtSpec}""")
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
@ -43,4 +43,13 @@ case "$os" in
|
||||
;;
|
||||
esac
|
||||
|
||||
g++ --std=c++11 $flags $os_flags -DTGT_OS_TYPE_$os_type -I $FPRIME -I $FPRIME/config -I $FPRIME/cmake/platform/types -I . $FPRIME_GCC_FLAGS $@
|
||||
g++ --std=c++11 \
|
||||
$flags \
|
||||
$os_flags \
|
||||
-DTGT_OS_TYPE_$os_type \
|
||||
-I $FPRIME \
|
||||
-I $FPRIME/config \
|
||||
-I $FPRIME/cmake/platform/types \
|
||||
-I . \
|
||||
$FPRIME_GCC_FLAGS \
|
||||
$@
|
||||
|
||||
@ -7,8 +7,6 @@
|
||||
#ifndef AbsTypeAliasAc_HPP
|
||||
#define AbsTypeAliasAc_HPP
|
||||
|
||||
#include <FpConfig.hpp>
|
||||
|
||||
#include "Fw/Types/BasicTypes.h"
|
||||
#include "T.hpp"
|
||||
|
||||
|
||||
@ -7,8 +7,6 @@
|
||||
#ifndef M_NamespacedAliasType2AliasAc_HPP
|
||||
#define M_NamespacedAliasType2AliasAc_HPP
|
||||
|
||||
#include <FpConfig.hpp>
|
||||
|
||||
#include "Fw/Types/BasicTypes.h"
|
||||
#include "NamespacedAliasTypeAliasAc.hpp"
|
||||
|
||||
|
||||
@ -7,8 +7,6 @@
|
||||
#ifndef M_M2_NamespacedAliasTypeAliasAc_HPP
|
||||
#define M_M2_NamespacedAliasTypeAliasAc_HPP
|
||||
|
||||
#include <FpConfig.hpp>
|
||||
|
||||
#include "Fw/Types/BasicTypes.h"
|
||||
#include "SimpleCType2AliasAc.hpp"
|
||||
|
||||
|
||||
@ -7,8 +7,6 @@
|
||||
#ifndef SimpleCType2AliasAc_H
|
||||
#define SimpleCType2AliasAc_H
|
||||
|
||||
#include <FpConfig.h>
|
||||
|
||||
#include "Fw/Types/BasicTypes.h"
|
||||
#include "SimpleCTypeAliasAc.h"
|
||||
|
||||
|
||||
@ -7,8 +7,6 @@
|
||||
#ifndef SimpleCType2AliasAc_HPP
|
||||
#define SimpleCType2AliasAc_HPP
|
||||
|
||||
#include <FpConfig.hpp>
|
||||
|
||||
#include "Fw/Types/BasicTypes.h"
|
||||
#include "SimpleCTypeAliasAc.hpp"
|
||||
|
||||
|
||||
@ -7,12 +7,10 @@
|
||||
#ifndef SimpleCTypeAliasAc_H
|
||||
#define SimpleCTypeAliasAc_H
|
||||
|
||||
#include <FpConfig.h>
|
||||
|
||||
#include "Fw/Types/BasicTypes.h"
|
||||
|
||||
//! A simple type alias that supports C codegen
|
||||
typedef U32 SimpleCType;
|
||||
#define PRI_SimpleCType PRI_u32
|
||||
#define PRI_SimpleCType PRIu32
|
||||
|
||||
#endif
|
||||
|
||||
@ -7,8 +7,6 @@
|
||||
#ifndef SimpleCTypeAliasAc_HPP
|
||||
#define SimpleCTypeAliasAc_HPP
|
||||
|
||||
#include <FpConfig.hpp>
|
||||
|
||||
#include "Fw/Types/BasicTypes.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
@ -7,11 +7,9 @@
|
||||
#ifndef TF32AliasAc_H
|
||||
#define TF32AliasAc_H
|
||||
|
||||
#include <FpConfig.h>
|
||||
|
||||
#include "Fw/Types/BasicTypes.h"
|
||||
|
||||
typedef F32 TF32;
|
||||
#define PRI_TF32 PRI_f32
|
||||
#define PRI_TF32 PRIf32
|
||||
|
||||
#endif
|
||||
|
||||
@ -7,8 +7,6 @@
|
||||
#ifndef TF32AliasAc_HPP
|
||||
#define TF32AliasAc_HPP
|
||||
|
||||
#include <FpConfig.hpp>
|
||||
|
||||
#include "Fw/Types/BasicTypes.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
@ -7,8 +7,6 @@
|
||||
#ifndef TStringAliasAc_HPP
|
||||
#define TStringAliasAc_HPP
|
||||
|
||||
#include <FpConfig.hpp>
|
||||
|
||||
#include "Fw/Types/String.hpp"
|
||||
|
||||
using TString = Fw::String;
|
||||
|
||||
@ -7,8 +7,6 @@
|
||||
#ifndef TStringSizeAliasAc_HPP
|
||||
#define TStringSizeAliasAc_HPP
|
||||
|
||||
#include <FpConfig.hpp>
|
||||
|
||||
#include "Fw/Types/String.hpp"
|
||||
|
||||
using TStringSize = Fw::String;
|
||||
|
||||
@ -7,11 +7,9 @@
|
||||
#ifndef TU32AliasAc_H
|
||||
#define TU32AliasAc_H
|
||||
|
||||
#include <FpConfig.h>
|
||||
|
||||
#include "Fw/Types/BasicTypes.h"
|
||||
|
||||
typedef U32 TU32;
|
||||
#define PRI_TU32 PRI_u32
|
||||
#define PRI_TU32 PRIu32
|
||||
|
||||
#endif
|
||||
|
||||
@ -7,8 +7,6 @@
|
||||
#ifndef TU32AliasAc_HPP
|
||||
#define TU32AliasAc_HPP
|
||||
|
||||
#include <FpConfig.hpp>
|
||||
|
||||
#include "Fw/Types/BasicTypes.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
@ -7,11 +7,9 @@
|
||||
#ifndef ATAliasAc_H
|
||||
#define ATAliasAc_H
|
||||
|
||||
#include <FpConfig.h>
|
||||
|
||||
#include "Fw/Types/BasicTypes.h"
|
||||
|
||||
typedef U32 AT;
|
||||
#define PRI_AT PRI_u32
|
||||
#define PRI_AT PRIu32
|
||||
|
||||
#endif
|
||||
|
||||
@ -7,8 +7,6 @@
|
||||
#ifndef ATAliasAc_HPP
|
||||
#define ATAliasAc_HPP
|
||||
|
||||
#include <FpConfig.hpp>
|
||||
|
||||
#include "Fw/Types/BasicTypes.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
@ -19,5 +19,5 @@ do
|
||||
cp $base.ref.hpp $base.hpp
|
||||
cp $base.ref.cpp $base.cpp
|
||||
echo "compiling $base.cpp"
|
||||
$fprime_gcc -Iinclude -c $base.cpp
|
||||
$fprime_gcc -Iinclude -I ../fprime/config -c $base.cpp
|
||||
done
|
||||
|
||||
@ -7,8 +7,6 @@
|
||||
#ifndef AliasAliasArrayAliasAc_HPP
|
||||
#define AliasAliasArrayAliasAc_HPP
|
||||
|
||||
#include <FpConfig.hpp>
|
||||
|
||||
#include "AliasArrayAliasAc.hpp"
|
||||
#include "Fw/Types/BasicTypes.h"
|
||||
|
||||
|
||||
@ -7,8 +7,6 @@
|
||||
#ifndef AliasArrayAliasAc_HPP
|
||||
#define AliasArrayAliasAc_HPP
|
||||
|
||||
#include <FpConfig.hpp>
|
||||
|
||||
#include "AArrayAc.hpp"
|
||||
#include "Fw/Types/BasicTypes.h"
|
||||
|
||||
|
||||
@ -7,8 +7,6 @@
|
||||
#ifndef AliasArrayAliasArrayAliasAc_HPP
|
||||
#define AliasArrayAliasArrayAliasAc_HPP
|
||||
|
||||
#include <FpConfig.hpp>
|
||||
|
||||
#include "ArrayAliasArrayArrayAc.hpp"
|
||||
#include "Fw/Types/BasicTypes.h"
|
||||
|
||||
|
||||
@ -7,8 +7,6 @@
|
||||
#ifndef AliasBoolAliasAc_HPP
|
||||
#define AliasBoolAliasAc_HPP
|
||||
|
||||
#include <FpConfig.hpp>
|
||||
|
||||
#include "Fw/Types/BasicTypes.h"
|
||||
|
||||
//! Alias of a boolean
|
||||
|
||||
@ -7,8 +7,6 @@
|
||||
#ifndef AliasEnumAliasAc_HPP
|
||||
#define AliasEnumAliasAc_HPP
|
||||
|
||||
#include <FpConfig.hpp>
|
||||
|
||||
#include "EEnumAc.hpp"
|
||||
#include "Fw/Types/BasicTypes.h"
|
||||
|
||||
|
||||
@ -7,12 +7,10 @@
|
||||
#ifndef AliasPrim1AliasAc_H
|
||||
#define AliasPrim1AliasAc_H
|
||||
|
||||
#include <FpConfig.h>
|
||||
|
||||
#include "Fw/Types/BasicTypes.h"
|
||||
|
||||
//! Alias of a primitive type
|
||||
typedef U32 AliasPrim1;
|
||||
#define PRI_AliasPrim1 PRI_u32
|
||||
#define PRI_AliasPrim1 PRIu32
|
||||
|
||||
#endif
|
||||
|
||||
@ -7,8 +7,6 @@
|
||||
#ifndef AliasPrim1AliasAc_HPP
|
||||
#define AliasPrim1AliasAc_HPP
|
||||
|
||||
#include <FpConfig.hpp>
|
||||
|
||||
#include "Fw/Types/BasicTypes.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
@ -7,12 +7,10 @@
|
||||
#ifndef AliasPrim2AliasAc_H
|
||||
#define AliasPrim2AliasAc_H
|
||||
|
||||
#include <FpConfig.h>
|
||||
|
||||
#include "Fw/Types/BasicTypes.h"
|
||||
|
||||
//! Alias of another primtive type
|
||||
typedef F32 AliasPrim2;
|
||||
#define PRI_AliasPrim2 PRI_f32
|
||||
#define PRI_AliasPrim2 PRIf32
|
||||
|
||||
#endif
|
||||
|
||||
@ -7,8 +7,6 @@
|
||||
#ifndef AliasPrim2AliasAc_HPP
|
||||
#define AliasPrim2AliasAc_HPP
|
||||
|
||||
#include <FpConfig.hpp>
|
||||
|
||||
#include "Fw/Types/BasicTypes.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
@ -7,8 +7,6 @@
|
||||
#ifndef AliasStringAliasAc_HPP
|
||||
#define AliasStringAliasAc_HPP
|
||||
|
||||
#include <FpConfig.hpp>
|
||||
|
||||
#include "Fw/Types/String.hpp"
|
||||
|
||||
//! Alias of a string
|
||||
|
||||
@ -7,8 +7,6 @@
|
||||
#ifndef AliasStructAliasAc_HPP
|
||||
#define AliasStructAliasAc_HPP
|
||||
|
||||
#include <FpConfig.hpp>
|
||||
|
||||
#include "Fw/Types/BasicTypes.h"
|
||||
#include "SSerializableAc.hpp"
|
||||
|
||||
|
||||
@ -7,8 +7,6 @@
|
||||
#ifndef AnotherAliasStructAliasAc_HPP
|
||||
#define AnotherAliasStructAliasAc_HPP
|
||||
|
||||
#include <FpConfig.hpp>
|
||||
|
||||
#include "Fw/Types/BasicTypes.h"
|
||||
#include "StructWithAliasSerializableAc.hpp"
|
||||
|
||||
|
||||
@ -18,5 +18,5 @@ do
|
||||
cp $base.$suffix $dest_base.$suffix
|
||||
done
|
||||
echo "compiling $dest_base.cpp"
|
||||
$fprime_gcc -I../../.. -c $dest_base.cpp
|
||||
$fprime_gcc -I../../.. -I ../fprime/config -c $dest_base.cpp
|
||||
done
|
||||
|
||||
@ -20,6 +20,32 @@ do
|
||||
done
|
||||
done
|
||||
|
||||
# Move Fw aliases (FpConfig.h dependencies) into config
|
||||
fp_config_aliases="
|
||||
FwChanIdType
|
||||
FwDpIdType
|
||||
FwDpPriorityType
|
||||
FwEnumStoreType
|
||||
FwEventIdType
|
||||
FwOpcodeType
|
||||
FwPacketDescriptorType
|
||||
FwPrmIdType
|
||||
FwSizeStoreType
|
||||
FwSizeType
|
||||
FwTimeBaseStoreType
|
||||
FwTimeContextStoreType
|
||||
FwTlmPacketizeIdType
|
||||
FwTraceIdType
|
||||
"
|
||||
|
||||
for base in ${fp_config_aliases}
|
||||
do
|
||||
for suffix in hpp h
|
||||
do
|
||||
mv ${base}AliasAc.$suffix config
|
||||
done
|
||||
done
|
||||
|
||||
# Move files into place by name prefix
|
||||
for dir in Buffer Cmd Dp Log Prm Time Tlm
|
||||
do
|
||||
|
||||
@ -7,8 +7,6 @@
|
||||
#ifndef TAliasAliasAc_HPP
|
||||
#define TAliasAliasAc_HPP
|
||||
|
||||
#include <FpConfig.hpp>
|
||||
|
||||
#include "Fw/Types/BasicTypes.h"
|
||||
#include "T.hpp"
|
||||
|
||||
|
||||
@ -7,11 +7,9 @@
|
||||
#ifndef U16AliasAliasAc_H
|
||||
#define U16AliasAliasAc_H
|
||||
|
||||
#include <FpConfig.h>
|
||||
|
||||
#include "Fw/Types/BasicTypes.h"
|
||||
|
||||
typedef U16 U16Alias;
|
||||
#define PRI_U16Alias PRI_u16
|
||||
#define PRI_U16Alias PRIu16
|
||||
|
||||
#endif
|
||||
|
||||
@ -7,8 +7,6 @@
|
||||
#ifndef U16AliasAliasAc_HPP
|
||||
#define U16AliasAliasAc_HPP
|
||||
|
||||
#include <FpConfig.hpp>
|
||||
|
||||
#include "Fw/Types/BasicTypes.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user