Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Inspecting uint8_t[] array (Read 2147 times)
level6
Junior Member
**
Offline


Posts: 18
Joined: Mar 21st, 2018
Inspecting uint8_t[] array
Apr 13th, 2018 at 1:39am
Print Post  
What is the best technique for inspecting an array of bytes, uint8_t at a breakpoint?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12155
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Inspecting uint8_t[] array
Reply #1 - Apr 13th, 2018 at 12:20pm
Print Post  
There isn't one other than adding your own loop and using serial.print(myArray[x])

In a breakpoint you can call methods {myMethod}

Code (C++)
Select All
void myMethod()
{

for (i=0;i<myArrayLen;i++)
{
serial.print(myArray[i])
serial.print(",")
}

} 

  
Back to top
IP Logged
 
level6
Junior Member
**
Offline


Posts: 18
Joined: Mar 21st, 2018
Re: Inspecting uint8_t[] array
Reply #2 - Apr 13th, 2018 at 7:41pm
Print Post  
I tried adding my method name to the breakpoint expression but I'm getting this compile error:  error: invalid use of void expression

Breakpoint expression: "{printBuffer()}"
tried with and without quotes.

void printBuffer()
{
     for (int i = 0; i < inputBufferSize; i++)
     {
           Serial.print(inputBuffer[i]);
           Serial.print(",");
     }
}
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12155
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Inspecting uint8_t[] array
Reply #3 - Apr 13th, 2018 at 9:55pm
Print Post  
oh try this

Code
Select All
char printBuffer()
{
     for (int i = 0; i < inputBufferSize; i++)
     {
           Serial.print(inputBuffer[i]);
           Serial.print(",");
     }

  return ''
} 

  
Back to top
IP Logged
 
level6
Junior Member
**
Offline


Posts: 18
Joined: Mar 21st, 2018
Re: Inspecting uint8_t[] array
Reply #4 - Apr 13th, 2018 at 11:16pm
Print Post  
Thanks. Working great now.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint