question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setting /max On Variable in .sym Leads To Malformed Range In Generated C Code

See original GitHub issue

The following .sym message:

FormatVersion=6.0 // Do not edit this line!
Title="Untitled"

{ENUMS}
Enum=Enum1()

{SIGNALS}
Sig=Signed_Int_Char char
Sig=Enum_Signal Enum1 8

{SENDRECEIVE}

[PDM_HeartBeat]
ID=001h
Len=8
Var=Variable1 unsigned 42,3 /max:1

produces the following struct:

/**
 * Signals in message PDM_HeartBeat.
 *
 * All signal values are as on the CAN bus.
 */
struct CanMsgs_pdm_heart_beat_t {
    /**
     * Range: ..1 (..1 -
     * Scale: 1
     * Offset: 0
     */
    uint8_t variable1;
};

Note that the range is ..1 (..1 -, where I would expect it to be something like * 0..1 (0..1 -)? Looks like this is a case of /max somehow being misinterpreted? What’s really confusing here is that the right value somehow makes it all the way from .sym->internal database->C source, so I suspect this is a bug with C source generation?

Please let me know if you need anything else! Thanks!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
garethellis0commented, Jan 15, 2019

Confirmed resolved in 32.5.3, thanks!

0reactions
eerimoqcommented, Jan 12, 2019

Fixed in 32.5.3, available on PyPI!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set assumption on symbolic object - MATLAB assume
Expression to set assumption on, specified as a symbolic variable, expression, vector, or matrix. If expr is a vector or matrix, then assume(expr,set)...
Read more >
How would you set a variable to the largest number possible ...
Firstly, include a header file named as math.h · Now, equate INT_MAX to the integer whose value you want to set maximum. EXAMPLE:...
Read more >
HI-TECH C Compiler for PIC18 MCUs - Microchip Technology
The driver instructs the code generator to preserve any C variables which map to symbols which are used, but not defined, ...
Read more >
HI-TECH PICC Compiler - NI
Specify and/or reserve ROM ranges. --RUNTIME=type. Configure the C runtime libraries to the specified type. --SCANDEP. Generate file ...
Read more >
HI-TECH PICC-18 STD Compiler - Datasheet Archive
2.4.5 -Gfile: Generate Source-level Symbol File . ... The code for max() in max.c will be linked into the program rather than the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found