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

Cleanup teletype dep on avr. #40

Closed
wants to merge 1 commit into from
Closed

Cleanup teletype dep on avr. #40

wants to merge 1 commit into from

Conversation

@pq
Copy link
Contributor

@pq pq commented Apr 23, 2016

Can we do without this include?

print_funcs.h pulls in a bunch of avr bits that are not needed/wanted when running teletype off the device.

cc @samdoshi @tehn

@samdoshi
Copy link
Collaborator

@samdoshi samdoshi commented Apr 23, 2016

Why not just pass -DSIM to your compiler? That will remove the include.

@pq
Copy link
Contributor Author

@pq pq commented Apr 23, 2016

Why not just pass -DSIM to your compiler? That will remove the include.

Because I'm an XCode newbie and I'm just trying to get it to stop yelling at me? ;)

I'm guessing the non sim case breaks otherwise? If that's the case, I'd expect that include to happen in main.c?

@pq
Copy link
Contributor Author

@pq pq commented Apr 23, 2016

Popping up, I'm curious why the include is there but can certainly work around it with -DSIM. Your call!

@samdoshi
Copy link
Collaborator

@samdoshi samdoshi commented Apr 23, 2016

As far as I know the include is used to making debugging over the serial port easier. It won't be broken as normally there aren't any debug statements uncommented. (And I deleted a lot when I went through the code.)

It's not a particularly clean solution, but I think if you want to remove that include, you'll need to make the rest of it consistent (i.e. deal with DBG), or better yet come up with an entirely different solution to conditional debugging.

Just incase you haven't got it working yet: http://stackoverflow.com/questions/26928622/add-preprocessor-macro-to-a-target-in-xcode-6

@tehn
Copy link
Member

@tehn tehn commented Apr 23, 2016

yeah, we need that in there. a SIM define should solve your issues.

@tehn tehn closed this Apr 23, 2016
@pq
Copy link
Contributor Author

@pq pq commented Apr 23, 2016

Thanks guys. @tehn: is this just as Sam suggests in order to make debugging on the device work if you uncomment debug statements? Or are other bits flipped/defined by the include too? Just trying to understand how it all hangs together!

@tehn
Copy link
Member

@tehn tehn commented Apr 23, 2016

the include simply redefines the print_dbg() functions so they get directed
at the avr UART rather than to stdio (screen)

so the idea is you can use the same debug prints for either the SIM or the
AVR.

theoretically if you were making a max external you could do a define so
that print_dbg redirects to printing at the max window, however you do that

On Sat, Apr 23, 2016 at 9:33 AM, Phil Quitslund notifications@github.com
wrote:

Thanks guys. @tehn https://github.com/tehn: is this just as Sam
suggests in order to make debugging on the device work if you uncomment
debug statements? Or are other bits flipped/defined by the include too?
Just trying to understand how it all hangs together!


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#40 (comment)

@pq
Copy link
Contributor Author

@pq pq commented Apr 25, 2016

Thanks @tehn. I'll stick to the SIM define for now. Cheers!

@pq pq deleted the pq:deps_cleanup branch Aug 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants