Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SerialUSB test port problem #52

Open
pedrorovi opened this issue Aug 29, 2023 · 0 comments
Open

SerialUSB test port problem #52

pedrorovi opened this issue Aug 29, 2023 · 0 comments

Comments

@pedrorovi
Copy link

pedrorovi commented Aug 29, 2023

Hi,
I am developing a project with the rp2040 with arduino framework, and I have a problem with unity config and the USB serial logs for Unity tests. I cannot see the logs/results from my tests with USB, but I can monitor the SerialUSB logs in my main function.
Any advice?

I had the same problem in another project, but is working with a pio serial tx that I created, and here, it's working if I use Serial1 (gpio 0-1).

unity_config.h

#ifndef NATIVE

#ifndef UNITY_CONFIG_H
#define UNITY_CONFIG_H

#ifndef NULL

#ifndef __cplusplus
#define NULL (void *)0
#else
#define NULL 0
#endif

#endif

#ifdef __cplusplus
extern "C" {
#endif

void unityOutputStart();
void unityOutputChar(char);
void unityOutputFlush();
void unityOutputComplete();

#define UNITY_OUTPUT_START() unityOutputStart()
#define UNITY_OUTPUT_CHAR(a) unityOutputChar(a)
#define UNITY_OUTPUT_FLUSH() unityOutputFlush()
#define UNITY_OUTPUT_COMPLETE() unityOutputComplete()

#ifdef __cplusplus
}
#endif /* extern "C" */

#endif /* UNITY_CONFIG_H */

#endif

unity_config.cpp

#ifndef NATIVE

#include "unity_config.h"

#include <Arduino.h>

void unityOutputStart() { SerialUSB.begin(115200); }
void unityOutputChar(char c) { SerialUSB.write(c); }
void unityOutputFlush() { SerialUSB.flush(); }
void unityOutputComplete() {}

#endif


@pedrorovi pedrorovi changed the title USB test port problem SerialUSB test port problem Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant