Re: [Flashforth-devel] Trying to make forth word SYNONYM
Brought to you by:
oh2aun
From: Mikael N. <mik...@fl...> - 2023-04-26 06:20:37
|
You could use conditional compilation instead. : ?\ ( fl --- ) 0= if postpone \ then ; immediate Described by Marc Petremann here: https://sourceforge.net/p/flashforth/discussion/726813/thread/6257e78a31/ BR Mikael On 2023-04-25 16:56, Tristan Williams wrote: > Hello Mikael, > > Thank you for your reply. > >> What is the use case for this. > > I'm not sure which size of the PIC18Fx6Q761 (or other PIC) I'm going > to use in my project and so a mcu pin attached to given piece of > hardware may change as result this or may just change as the project > develops. I want to write some of the firmware at the same time as I > test out the hardware and the mcu choices. Having synonym would allow > me to map a descriptive pin name to its actual pin easily. I have pins > defined as RA0 RA1 etc. where RA0 results in ( -- mask port ) so I > could map > > alias motor_enable RA0 > alias fan_enable RA1 > > and then use motor_enable in subsequent code and only need to change > the > mapping at the top of the file > |