<veltas>
But it is a shame to have a situation where I don't know how to use a page correctly because my screen is smaller and stuff gets deleted
<tabemann>
back
TCZ has joined #forth
jsoft has joined #forth
<veltas>
The "Code It Yourself" manifesto reads like a parody of the Agile manifesto, I wonder if that's intentional
<veltas>
crc: Is there a bit in the guide explaining [ and ] ?
<crc>
veltas: no, but I will rectify that this weekend
<crc>
I think the CSS for the sidebar should be working for 1024 width now
<veltas>
crc: It is
<veltas>
I am into the "Aim For The Bushes" manifesto
<veltas>
Okay nn, thanks for your support today crc hopefully I will play with retro at some point, was just trying to 'learn' the language a bit properly
inkajoo has quit [Ping timeout: 256 seconds]
rdrop-exit has joined #forth
<rdrop-exit>
good morning Forthwrights (-_-)zzz c[]
<crc>
hi rdrop-exit
<rdrop-exit>
hi crc :)
* crc
should write a bot to count the nunber of cups of coffee that appear in this channel
<rdrop-exit>
:-))
<tp>
morning Forth Zen Guru!
<rdrop-exit>
hi Forth Master Tech (tm)
<tp>
rdrop-exit, how goes Manilla ?
<rdrop-exit>
ok, more of the same
<rdrop-exit>
c[]
TCZ has quit [Quit: Leaving]
iyzsong has joined #forth
boru` has joined #forth
boru has quit [Disconnected by services]
boru` is now known as boru
<rdrop-exit>
what's new in the forth world?
<tp>
rdrop-exit, I think Ive finished my stack comments, would you mind casting a eye over a short summary of my different auto generated words ?
<tp>
the reason is all the bitfields MUST be words
<rdrop-exit>
a constant is a word
iyzsong has quit [Read error: Connection reset by peer]
<tp>
ok
<tp>
ahhm you want to make every bitmask a constant ?
proteus-guy has joined #forth
<rdrop-exit>
that's what I would do
<tp>
ok, I admit I had no clue there for a while
<tp>
(whats new?)
iyzsong has joined #forth
<tp>
now a bitmask is just a particular bit(s) within a register
<rdrop-exit>
yes
<tp>
so currently in V3 our example is
<tp>
: RCC_CR_HSERDY ( -- x addr ) 17 bit RCC_CR ;
<tp>
* incedentally, that definition also makes the actual bit easy to find in the doc
<tp>
as in it's bit 17 of RCC_CR
<tp>
rdrop-exit, so using that definition, how would you make RCC_CR_HSERDY a constant ?
<tp>
I'm still not visualising what you mean
<rdrop-exit>
<bitmask> constant <name>
<tp>
the problem I see is that <bitmask> MUST be associated with RCC_CR it cant be used anywhere else
<tp>
you can't have a 'floating' bitmask
<tp>
and you cannot do it from memory
<tp>
not with up to 17000+ bitmasks
<tp>
well maybe YOU can, I can only remember up to 2 things at anyone time :)
<rdrop-exit>
that depends on the target, i.e. if some masks are the same across a subset of the registers
<tp>
no
<rdrop-exit>
yes
<tp>
masks are NOT unique at all times, not even across the same register
<tp>
unfortunately
<rdrop-exit>
that's what I said, it DEPENDS on the target
<tp>
ask me how I know this ?
<rdrop-exit>
no
<tp>
hahah
<rdrop-exit>
:))
<tp>
thew target is cortex-m
<tp>
svd2forth only applies to cortex-m here
<tp>
rdrop-exit, interestingly I see this same methodology youre proposing amongst the C programmer people
<rdrop-exit>
I don't think it's related to C or not C
<tp>
they have no idea that the bitfield names must be associated with each register, and each register with each peripheral or there will be collisions
<tp>
no, I dont either, I do think it's a programmer thing amongst those that dont do much embedded
<rdrop-exit>
it depends
<tp>
yeah it depends on the target
<rdrop-exit>
you might have 3 identical peripherals that you access via different registers, but share the same register layout
<tp>
I have ben meaning to write a program that examines any cmsis-svd file for collisions
<tp>
thats true, but they have different constants
<tp>
a good example would be the USARTS
<tp>
there may be 6 of them, all the same except for the peripheral memory constant
<tp>
but the register and bitfields are the same
<tp>
however the timers, and there are about 7 - 12 of them have about 4 variations
<tp>
so thats hard to say
<tp>
and in a different model, they may have other variations, so this method could become error prone fast
<tp>
thats why I do every register separately
<tp>
i see where youre going there for once, and it's a great idea, I just cant see it working well due to all the differences
<rdrop-exit>
I use that as my starting point, where I go from there depends on the specifics
<rdrop-exit>
My starting point is always register constants, bitfield constants
<tp>
you have once again given me a lot to think about :)
<rdrop-exit>
I have a bunch of words to extract, manipulate, and pack bitfields that I can use by having that starting point
<tp>
the main thing to know is that bitfields cannot exit in isolation, they belong to the same register they are defined in withing the cmsis-svd files
<tp>
of course we have been thru this before, your needs are quite different to mine. I need to define all 17000+ bitfields automatically
<tp>
you will do all yours by hand
<tabemann>
back again
<tp>
hey tabemann
<rdrop-exit>
yes
<rdrop-exit>
I always start with their spec
proteus-guy has quit [Ping timeout: 265 seconds]
<rdrop-exit>
I use a similar approach for protocols as well
<rdrop-exit>
(and their bitfields)
<tp>
in the case of cortex-m, cmsis-svd IS the spec
<tp>
it's made by the manufacturer of the chip
<rdrop-exit>
I prefer real specs :)
<tp>
and their tech docs use it to make the tech docs
<tp>
the tech docs use it, theyre one and the same
<rdrop-exit>
then I choose the spec that's a real document
<tp>
paper you mena ?
<tp>
mean
<tp>
as in a book ?
<rdrop-exit>
I mean the one that's designed for reading with my eyes
<tp>
because the PDF specs are sourced from the cmsis-svd
<rdrop-exit>
:)
<rdrop-exit>
brb
<tp>
no problemo, and thanks for the suggestions :)
proteus-guy has joined #forth
<rdrop-exit>
back c[]
<tp>
off to get some lunch :)
<tp>
bbl
<rdrop-exit>
bon appetit! :)
merkc0 has joined #forth
gravicappa has joined #forth
proteus-guy has quit [Ping timeout: 260 seconds]
rdrop-exit has quit [Quit: Lost terminal]
proteus-guy has joined #forth
tabemann has quit [Remote host closed the connection]
tabemann has joined #forth
merkc0 has quit [Quit: Leaving]
merkc0 has joined #forth
<merkc0>
: BOX ( w h -- )
<merkc0>
R> 0 DO
<merkc0>
." *"
<merkc0>
2>R
<merkc0>
R> 0 ?DO
<merkc0>
LOOP CR
<merkc0>
LOOP
<merkc0>
;
<merkc0>
2 10 BOX
<merkc0>
any Idea why it enters an infinite loop?
<merkc0>
oh the inner R> is called repeatedly, that's not correct
<crc>
maybe try: : box 0 do dup 0 do ." *" loop cr loop drop ; or : box 2>r r> 0 do r@ 0 do ." *" loop cr loop rdrop ;
<merkc0>
thanks, the 1st solution works, the 2nd one with 2>R R> R@ RDROP still infinite loops
<crc>
do/loop may be doing something with the return stack, probably with the loop indices
<merkc0>
yes
* crc
can't test this currently as the only forth on my current system (an ipad) isn't a standard system
_whitelogger has joined #forth
guan has quit [*.net *.split]
jimt[m] has quit [*.net *.split]
tp has quit [*.net *.split]
APic has quit [*.net *.split]
guan has joined #forth
APic has joined #forth
jimt[m] has joined #forth
tp has joined #forth
rdrop-exit has joined #forth
merkc1 has joined #forth
inkajoo has quit [Ping timeout: 265 seconds]
merkc0 has quit [Ping timeout: 258 seconds]
merkc1 has quit [Ping timeout: 256 seconds]
xek has joined #forth
<veltas>
Oh right c[] is a cup of coffee
<veltas>
That makes sense now
<veltas>
tp: "sometimes the numbers are so large, XSLT reverts to sci notation"
<veltas>
That is what I will focus on, use something else :)
<veltas>
Has anyone considered stack comments make more sense phantoming where the parameters would be in usage or as equivalent demo code?
<veltas>
Like why not : ( w h ) BOX
<veltas>
If you called BOX by hand you'd write the w and h there in front
<veltas>
Well because : doesn't care about comments
<veltas>
But another example, in code sometimes people write out what's happening on stack in different ways
<veltas>
But what I do atm is put comments with what's on the stack occasionally in front of the code that uses it
<veltas>
and that always seems to give me shorter comments
<veltas>
Like this code: : AT-XY ( x y -- ) ( y ) 0 23 CLAMP T-ROW C! ( x ) 0 63 CLAMP T-COL C! ;
<veltas>
You could do ( w h ) : BOX
<tp>
veltas, whay do you want shorter comments ?
<veltas>
And ( n1 n2 ) : + ( n )
<veltas>
tp: If they make as much sense, they're easier to read
<veltas>
shorter everything is usually easier to read if it still makes sense
<tp>
true
<tp>
most of my comments are technical, very hard to shorten
<rdrop-exit>
c[] back
<tp>
: RCC_CIR_CSSC ( -- x addr ) 23 bit RCC_CIR ; \ RCC_CIR_CSSC, Clock security system interrupt clear
<tp>
veltas, thats a typical example
<veltas>
I'm talking about stack comments right now
<tp>
ok
<rdrop-exit>
what about them?
<veltas>
But if we're talking about your code let's talk XSLT
<tp>
sure
<tp>
XSLT is everyones favorite Forth I know ;-)
<tp>
people might sue us for being off topic
<tp>
veltas, but we can discuss it all we like on my embedded ch #mecrisp
<veltas>
But I need to sue you for being off topic
<veltas>
That's how the courts work these days, instead of having reasonable rules about what you can be sued for they gave up and now you have to counter-sue over everything
<tp>
hey it works for the lawyers!
<veltas>
lol tp come on it's not like judges are friends with only lawyers and other judges, therefore having an incentive to make law drag on for everyone else when it's pointless ;-)
<tp>
no, couldn't be!
<tp>
it's not pointless if you bill by the hour ?
<tp>
but back to Forth before everyone puts you on ignore
<tp>
they come here for Forth, I'm already ignored enough
<rdrop-exit>
veltas, what is your definition of CLAMP ?
<veltas>
: CLAMP ROT MIN MAX ;
<veltas>
without comments
<rdrop-exit>
are your x y signed or unsigned ?
<veltas>
( n1 n2 n3 -- n ) \ clamp n1 between n2 and n3
<veltas>
signed
<veltas>
Well either really but I treat them as signed because the standard unsigned words tend to be more limited
<rdrop-exit>
I see
<veltas>
Here it really doesn't matter because the variables being modified are c-variable's
<veltas>
And if you were trying to set it to 32768 then your code was doing something wrong anyway probably
<rdrop-exit>
couldn't you achieve the same thing with 23 umin ... 63 umin ?
<rdrop-exit>
oops
<rdrop-exit>
never mind
<rdrop-exit>
brain fart
<rdrop-exit>
I forgot you use signed coordinates
<rdrop-exit>
I always use unsigned coordinates
<rdrop-exit>
or linear offsets
dddddd has joined #forth
merkc1 has joined #forth
<veltas>
rdrop-exit: No I don't use signed coordinates
<veltas>
But if I had -1, 0 seems closer to the correct value than 63
<veltas>
Coordinates are between 0 and 63
<rdrop-exit>
if you're using unsigned coordinates than -1 is a very large number
<veltas>
Yes
<rdrop-exit>
so it would make sense to clip it to your highest valid coordinate if you're going to clip it anyway
<veltas>
But if you're using simple increments/decrements half the time and get it wrong by one you will get -1, or 65535, either way is *meant* to be something near 0 rather than 63
<veltas>
If I want to do it with modular arithmetic I could AND it, but I don't, I want to clamp it.
<veltas>
Or e.g. you are doing some bad geometry calculation and you want something off the side of the screen, my method will put it on the correct side of the screen at least
<rdrop-exit>
ya, I usually don't bother either way