The brand-new PN400 Phase Noise Test System is available for purchase! →

shr_parser errors

Forums › General Discussions › shr_parser errors

  • This topic has 2 replies, 2 voices, and was last updated 6 months ago by Joe.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #255014
    Joe
    Participant

    I am trying to compile the example signal_hound_sdk/shr_parser/main.cpp. When viewing the source file in VS Code (WSL: Ubuntu) line 40 and 42 cause the error “format ‘%f’ expects argument of type ‘double’, but argument 2 has type ‘int32_t’ {aka ‘int’} [-Wformat=]”

    Is this expected behavior? Can you please clarify what the type should be?

    #255018
    AndrewAndrew
    Moderator

    Hi Joe,

    Looks like an incomplete branch. Looks like it was copied from the branch above and not finished.

    It should probably look more like this,

    
    if(state.header.decimationDetector == SHRDecimationDetectorAvg) {
        printf("Averaged trace(s) for %.2f seconds per output trace\n", state.header.decimationTimeMs / 1000.0);
    } else {
        printf("Max held trace(s) for %.2f seconds per output trace\n", state.header.decimationTimeMs / 1000.0);
    }
    

    This is untested, but I think is closer to what was intended. If you are able to try that, let me know if it prints what you expect.

    • This reply was modified 6 months ago by AndrewAndrew.
    • This reply was modified 6 months ago by AndrewAndrew.
    • This reply was modified 6 months ago by AndrewAndrew.
    • This reply was modified 6 months ago by AndrewAndrew.
    #255038
    Joe
    Participant

    Andrew,

    Thanks that worked!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.