logs archiveBotHelp.net / Freenode / #43oh / 2015 / September / 18 / 1
ike
or maybe 32MB+ "honest mistake"
people in coments say it's fake
8GB or less
Amperture
Like those cheap portable hard drives from ebay that you open up and is just an extra case around a flash drive.
on3pk
Hey guys, I'm trying to figure out whats going on in some code. PC is defined as unsigned char *PC = (unsigned char *) 0x40006000;
Later on is: PC[0x400] |= 0xF0;
What exactly is being referenced? Is it 0x40006400?
I mean, that's what it looks like is happening. I just don't think I've seen something written that way before
vigs
Off the top of my head&0x400 bytes after PC get their second nibble set high
similar to this: *(PC+0x400) |= 0xF0
on3pk
vigs, yep, the code is to set a portion of port c to output
vigs
maybe it's late, but I'm totally having trouble parsing the end of that sentence
Port C?
on3pk
HEH, it's late for me too
vigs
Oh, you probably mean a port on your microcontroller.
on3pk
Yeah
vigs
But yeah, that's my take on that snippet. Does it make sense given the context?
on3pk
Yes
vigs
Great!
on3pk
I just haven't seen the offset expressed like that before
vigs
I'm not sure why you'd have to access memory addresses by hand like that, though. The msp's header files handle all that for you.
on3pk
Heh, I didn't write this.
Rickta59
which chip is that on3pk ?
msp432?
vigs
I feel like I've used offsets like that because I didn't wanna reach all the way up to the asterisk and paren keys
on3pk
Rickta59, Stellaris something... whatever is on the launchpad
vigs
And hit Shift at the same time? Ugh, so much work. :P
Rickta59
the tiva or tm4c?
on3pk
Rickta59, uhm, Tiva C --- though doesn't the tiva c part numbers start with tm4c?
Rickta59
0x4000.6000 0x4000.6FFF GPIO Port C 658
so it is setting a flag on the GPIO C register
on3pk
Rickta59, yes
Rickta59
so do you understand what is going on?
on3pk
Rickta59, yes. I guess it was the actual syntax that threw me off. I haven't seen the offset put in brackets like that before
Rickta59
they could have written it like *(PC+0x400) = 0xF0;
PC[0] is the same as *PC
if PC was an integer ...
PC[0x400] is the same as *(PC+0x400) ...
but that actual address would be pc + 0x400*4
because of the size of an int
are they trying to avoid using .h files?
on3pk
Rickta59, maybe
Not really sure what the motivation was, but it seems a lot simpler to use the TI header files
Rickta59
or is it an asm translation?
on3pk
That may also be the case
Rickta59
what are you using the board to do?
on3pk
Rickta59, Uhm, the point of this code was to get familiarized with a logic analyzer
It just outputs stuff
Ugh, I gotta make my hobbies more consistent
Rickta59
the logic analyzer is for a class ? or something you purchased?
on3pk
For a class
Everything is for a class. I'll never get out into the world :(
« prev next »