Open ethancheez opened 3 weeks ago
I think this is a good use case to push the development of displayable abstract types. I was playing with this and I think rather than hardcoding a whole bunch of core types using a pattern like this might be more flexible for a wider range of platforms:
# type SYSTEM_MAX_INT
struct MEMORY_USAGE_S {
TOTAL: FwSizeType
USED: FwSizeType
NV_TOTAL: FwSizeType
NV_FREE: FwSizeType
}
@ Total system memory usage in KB
telemetry MEMORY_USAGE: MEMORY_USAGE_S id 0
@ System's CPU Percentage
constant NUM_CORES = 15
struct CPU_USAGE_S {
AVG: F32,
CORE: [NUM_CORES] F32
}
telemetry CPU_USAGE: CPU_USAGE_S id 4
@ethancheez if you build in the deployment directory, it should only build components used. If you build in the root directory, you must specifically exclude these components.
A possible better version would be to use restrict_platforms(FPRIME_HAS_INTEGER64)
and add that to platforms, but this is a further future change.
Svc.SystemResources
,Svc.DpCatalog
,Svc.DpWriter
,Svc.DpManager
,Svc.FileManager
Problem Description
On 32-bit systems, the components listed above implement 64-bit types (
U64
)Context / Environment
How to Reproduce
When these macros are set:
Expected Behavior
Check if architecture supports
FW_HAS_64_BIT
, useU64
. Otherwise, useU32
.Is it possible to configure your project so that you only include the
Svc
components only if they are included in yourinstances.fpp
file? i.e. My projectinstances.fpp
does not useSvc.SystemResources
, but the project still continues to buildSvc.SystemResources
which results in theU64
undefined error.I can use:
But was wondering if there was a way to not build those components without inputting this line.