1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-02-27 02:56:04 +01:00

done down to ONCLOCKTIME

getting bored... need a break.
This commit is contained in:
Asbelos 2025-02-06 20:00:28 +00:00
parent 20c54b2590
commit 6512aa5b1b

View File

@ -202,23 +202,23 @@
/** /**
* @def ACTIVATE(addr,subaddr) * @def ACTIVATE(addr,subaddr)
* @brief Send DCC Accessory Activate packet (gate on then off) * @brief Send DCC Accessory Activate packet (gate on then off)
* @param addr * @param addr DCC short address of accessory
* @param subaddr * @param subaddr DCC sub address
*/ */
#define ACTIVATE(addr,subaddr) #define ACTIVATE(addr,subaddr)
/** /**
* @def ACTIVATEL(longaddr) * @def ACTIVATEL(linearaddr)
* @brief Send DCC Accessory Activate packet (gate on then off) * @brief Send DCC Accessory Activate packet (gate on then off)
* @param longaddr * @param linearaddr DCC linear address of accessory
*/ */
#define ACTIVATEL(longaddr) #define ACTIVATEL(linearaddr)
/** /**
* @def AFTER(sensor_id,timer...) * @def AFTER(vpin,timer...)
* @brief Wait for sensor activated, then decativated for given time * @brief Wait for sensor activated, then decativated for given time
* @param sensor_id * @param vpin Virtual Pin number of sensor
* @param timer... optional wait in mS, default 500 * @param timer... optional wait in mS, default 500
*/ */
#define AFTER(sensor_id,timer...) #define AFTER(vpin,timer...)
/** /**
* @def AFTEROVERLOAD(track_id) * @def AFTEROVERLOAD(track_id)
* @brief Wait for overload to be resolved * @brief Wait for overload to be resolved
@ -228,13 +228,14 @@
/** /**
* @def ALIAS(name,value...) * @def ALIAS(name,value...)
* @brief defines a named numeric value. * @brief defines a named numeric value.
* @param name * @param name c++ variable name that can be used throighout the script
* @param value... if omitted, a large negative value is created automatically * @param value... if omitted, a large negative value is created automatically
*/ */
#define ALIAS(name,value...) #define ALIAS(name,value...)
/** /**
* @def AMBER(signal_id) * @def AMBER(signal_id)
* @brief Sets a signal to amber state * @brief Sets a signal to amber state
* @see ONAMBER
* @param signal_id * @param signal_id
*/ */
#define AMBER(signal_id) #define AMBER(signal_id)
@ -249,49 +250,49 @@
*/ */
#define ANOUT(vpin,value,param1,param2) #define ANOUT(vpin,value,param1,param2)
/** /**
* @def AT(sensor_id) * @def AT(vpin)
* @brief wait intil a sensor becomes active * @brief wait intil a sensor becomes active
* @param sensor_id Use negative value for sensors that are HIGH when activated * @param vpin Virtual pin of sensor. Use negative value for sensors that are HIGH when activated
*/ */
#define AT(sensor_id) #define AT(vpin)
/** /**
* @def ASPECT(address,value) * @def ASPECT(address,value)
* @brief Sends a DCC aspect value to an accessory address. * @brief Sends a DCC aspect value to an accessory address.
* May also change status of a signal defined using this aspect. * May also change status of a signal defined using this aspect.
* @param address * @param address Linear DCC address of device
* @param value * @param value Aspect value (Device dependent)
*/ */
#define ASPECT(address,value) #define ASPECT(address,value)
/** /**
* @def ATGTE(sensor_id,value) * @def ATGTE(vpin,value)
* @brief Wait for analog sensor to be greater than given value * @brief Wait for analog sensor to be greater than given value
* @param sensor_id * @param vpin Analog pin number
* @param value * @param value integer value to compare against
*/ */
#define ATGTE(sensor_id,value) #define ATGTE(vpin,value)
/** /**
* @def ATLT(sensor_id,value) * @def ATLT(vpin,value)
* @brief Wait for analog sensor value to be less than given value * @brief Wait for analog sensor value to be less than given value
* @param sensor_id * @param vpin Analog pin number
* @param value * @param value integer value to compare against
*/ */
#define ATLT(sensor_id,value) #define ATLT(vpin,value)
/** /**
* @def ATTIMEOUT(sensor_id,timeout_ms) * @def ATTIMEOUT(vpin,timeout_ms)
* @brief Wait for sensor active, with timeout. Use IFTIMEOUT to determine whether the AT was satisfied. * @brief Wait for sensor active, with timeout. Use IFTIMEOUT to determine whether the AT was satisfied.
* @see IFTIMEOUT * @see IFTIMEOUT
* @param sensor_id * @param vpin Sensor pin number
* @param timeout_ms * @param timeout_ms Millseconds to wait before timeout
*/ */
#define ATTIMEOUT(sensor_id,timeout_ms) #define ATTIMEOUT(vpin,timeout_ms)
/** /**
* @def AUTOMATION(id,description) * @def AUTOMATION(sequence_id,description)
* @brief Defies starting point of a sequence that will be shown as an Automation by * @brief Defines starting point of a sequence that will be shown as an Automation by
* the throttles. Automations are started by the throttle handing over a loco id to be driven. * the throttles. Automations are started by the throttle handing over a loco id to be driven.
* @param id Unique sequence/route/automation id * @param sequence_id Unique sequence id value
* @param description (Quoted text) will be shown on throttle button * @param description (Quoted text) will be shown on throttle button
*/ */
#define AUTOMATION(id,description) #define AUTOMATION(sequence_id,description)
/** /**
* @def AUTOSTART * @def AUTOSTART
* @brief A new task will be created starting from this point at Command Station startup * @brief A new task will be created starting from this point at Command Station startup
@ -301,7 +302,7 @@
* @def BLINK(vpin,onDuty,offDuty) * @def BLINK(vpin,onDuty,offDuty)
* @brief Starts a blinking process for a vpin (typically a LED) * @brief Starts a blinking process for a vpin (typically a LED)
* Stop blink with SET or RESET. * Stop blink with SET or RESET.
* @param vpin * @param vpin Pin to blink
* @param onDuty Milliseconds with LED ON * @param onDuty Milliseconds with LED ON
* @param offDuty Milliseconds with LED off * @param offDuty Milliseconds with LED off
*/ */
@ -314,96 +315,95 @@
*/ */
#define BROADCAST(msg) #define BROADCAST(msg)
/** /**
* @def CALL(route) * @def CALL(sequence_id)
* @brief transfer control to another sequence with expectation to return * @brief transfer control to another sequence with expectation to return
* @see RETURN * @see RETURN
* @param route Sequence id, sequence must terminate of RETURN * @param sequence_id SEQUENCE to jump processing to, must terminate or RETURN
* *
*/ */
#define CALL(route) #define CALL(sequence_id)
/** /**
* @def CLEAR_STASH(id) * @def CLEAR_STASH(stash_id)
* @brief Clears loco stash value * @brief Clears loco value stored in stash
* @param id which stash to clear. * @param stash_id which stash to clear.
*/ */
#define CLEAR_STASH(id) #define CLEAR_STASH(stash_id)
/** /**
* @def CLEAR_ALL_STASH(id) * @def CLEAR_ALL_STASH
* @brief ??????????????????????????????????????? * @brief Clears all stashed loco values
* @param id
*/ */
#define CLEAR_ALL_STASH(id) #define CLEAR_ALL_STASH
/** /**
* @def CLOSE(id) * @def CLOSE(turnout_id)
* @brief Close turnout by id * @brief Close turnout by id
* @see THROW * @see THROW
* @param id * @param turnout_id
*/ */
#define CLOSE(id) #define CLOSE(turnout_id)
/** /**
* @def CONFIGURE_SERVO(vpin,pos1,pos2,profile) * @def CONFIGURE_SERVO(vpin,pos1,pos2,profile)
* @brief setup servo movement parameters for non-turnout * @brief setup servo movement parameters for non-turnout
* @param vpin must refer to a servo capable pin * @param vpin must refer to a servo capable pin
* @param pos1 SET position of servo * @param pos1 SET position of servo
* @param pos2 RESET position of servo * @param pos2 RESET position of servo
* @param profile Movement profile (????????) * @param profile Movement profile (Instant, Fast, Medium, Slow, Bounce)
*/ */
#define CONFIGURE_SERVO(vpin,pos1,pos2,profile) #define CONFIGURE_SERVO(vpin,pos1,pos2,profile)
/** /**
* @def DCC_SIGNAL(id,add,subaddr) * @def DCC_SIGNAL(signal_id,addr,subaddr)
* @brief Define a DCC accessory signal with short address * @brief Define a DCC accessory signal with short address
* @param id Signal id used for all signal manipulation commands * @param signal_id Id used for all signal manipulation commands
* @param add DCC address * @param addr DCC address
* @param subaddr DCC subaddress * @param subaddr DCC subaddress
*/ */
#define DCC_SIGNAL(id,add,subaddr) #define DCC_SIGNAL(signal_id,addr,subaddr)
/** /**
* @def DCCX_SIGNAL(id,redAspect,amberAspect,greenAspect) * @def DCCX_SIGNAL(signal_id,redAspect,amberAspect,greenAspect)
* @brief DEfine advanced DCC accessory signal with aspects * @brief Dfeine advanced DCC accessory signal with aspects
* @param id Signal id used for all signal manipulation commands * @param signal_id DCC Linear address AND Id used for all signal manipulation commands
* @param redAspect * @param redAspect
* @param amberAspect * @param amberAspect
* @param greenAspect * @param greenAspect
*/ */
#define DCCX_SIGNAL(id,redAspect,amberAspect,greenAspect) #define DCCX_SIGNAL(signal_id,redAspect,amberAspect,greenAspect)
/** /**
* @def DCC_TURNTABLE(id,home,description...) * @def DCC_TURNTABLE(turntable_id,id,home,description...)
* @brief ?????????????????????????????????? * @brief defines a Turntable device
* @param id * @param turntable_id ??? TODO ???
* @param home * @param home ??? TODO ???
* @param description... * @param description... Quotyed text description of turntable
*/ */
#define DCC_TURNTABLE(id,home,description...) #define DCC_TURNTABLE(tuirntable_id,home,description...)
/** /**
* @def DEACTIVATE(addr,subaddr) * @def DEACTIVATE(addr,subaddr)
* @brief Sends DCC Deactivate packet (gate on, gate off) to short address * @brief Sends DCC Deactivate packet (gate on, gate off)
* @param addr * @param addr DCC accessory address
* @param subaddr * @param subaddr DCC accessory subaddress
*/ */
#define DEACTIVATE(addr,subaddr) #define DEACTIVATE(addr,subaddr)
/** /**
* @def DEACTIVATEL(addr) * @def DEACTIVATEL(addr)
* @brief Sends DCC Deactivate packet (gate on, gate off) to long address * @brief Sends DCC Deactivate packet (gate on, gate off)
* @param addr * @param addr DCC Linear accessory address
*/ */
#define DEACTIVATEL(addr) #define DEACTIVATEL(addr)
/** /**
* @def DELAY(mindelay) * @def DELAY(delay_mS)
* @brief Waits for given milliseconds delay (This is not blocking) * @brief Waits for given milliseconds delay (This is not blocking)
* @param mindelay mS * @param delay_mS Delay time in milliseconds
*/ */
#define DELAY(mindelay) #define DELAY(delay_ms)
/** /**
* @def DELAYMINS(mindelay) * @def DELAYMINS(delay_minutes)
* @brief Waits for given minutes delay (This is not blocking) * @brief Waits for given minutes delay (This is not blocking)
* @param mindelay * @param delay_minutes
*/ */
#define DELAYMINS(mindelay) #define DELAYMINS(delay_minutes)
/** /**
* @def DELAYRANDOM(mindelay,maxdelay) * @def DELAYRANDOM(mindelay,maxdelay)
* @brief Waits for random delay between min and max milliseconds (This is not blocking) * @brief Waits for random delay between min and max milliseconds (This is not blocking)
* @param mindelay mS * @param mindelay minumum delay in mS
* @param maxdelay mS * @param maxdelay maximum delay in mS
*/ */
#define DELAYRANDOM(mindelay,maxdelay) #define DELAYRANDOM(mindelay,maxdelay)
/** /**
@ -420,16 +420,13 @@
/** /**
* @def ELSE * @def ELSE
* @brief introduces alternate processing path after any kind of IF * @brief introduces alternate processing path after any kind of IF
* @see IF
*/ */
#define ELSE #define ELSE
/**
* @def ENDEXRAIL
* @brief Obsolete, has no effect.
*/
#define ENDEXRAIL
/** /**
* @def ENDIF * @def ENDIF
* @brief determines end of IF(any type) block. * @brief determines end of IF(any type) block.
* @see IF
* IF something ENDIF, or * IF something ENDIF, or
* IF something ELSE something ENDIF * IF something ELSE something ENDIF
*/ */
@ -445,11 +442,6 @@
* @brief Performs emergency stop on current task loco * @brief Performs emergency stop on current task loco
*/ */
#define ESTOP #define ESTOP
/**
* @def EXRAIL
* @brief OBSOLETE ignored
*/
#define EXRAIL
/** /**
* @def EXTT_TURNTABLE(id,vpin,home,description...) * @def EXTT_TURNTABLE(id,vpin,home,description...)
* @brief ?????????????????????? * @brief ??????????????????????
@ -460,29 +452,29 @@
*/ */
#define EXTT_TURNTABLE(id,vpin,home,description...) #define EXTT_TURNTABLE(id,vpin,home,description...)
/** /**
* @def FADE(pin,value,ms) * @def FADE(vpin,value,ms)
* @brief Modifies analog value slowly taking a given time * @brief Modifies analog value slowly taking a given time
* @param pin * @param vpin Servo virtual pin number
* @param value new target value * @param value new target value
* @param ms time to reach value * @param ms time to reach value
*/ */
#define FADE(pin,value,ms) #define FADE(vpin,value,ms)
/** /**
* @def FOFF(func) * @def FOFF(func)
* @brief Turns off loco function for current loco * @brief Turns off current loco function
* @see FON * @see FON
* @param func * @param func
*/ */
#define FOFF(func) #define FOFF(func)
/** /**
* @def FOLLOW(route) * @def FOLLOW(sequence_id)
* @brief Task processing follows given route or sequence (Effectively a GoTo) * @brief Task processing follows given route or sequence (Effectively a GoTo)
* @param route * @param sequence_id
*/ */
#define FOLLOW(route) #define FOLLOW(sequence_id)
/** /**
* @def FON(func) * @def FON(func)
* @brief Turn on current loc finction * @brief Turn on current loco function
* @see FOFF * @see FOFF
* @param func * @param func
*/ */
@ -493,12 +485,12 @@
*/ */
#define FORGET #define FORGET
/** /**
* @def FREE(blockid) * @def FREE(token_id)
* @brief Frees logical token for given block. * @brief Frees logical token
* @see RESERVE * @see RESERVE
* @param blockid 0..255 * @param token_id 0..255
*/ */
#define FREE(blockid) #define FREE(token_id)
/** /**
* @def FTOGGLE(func) * @def FTOGGLE(func)
* @brief Toggles function for current loco * @brief Toggles function for current loco
@ -521,20 +513,20 @@
* @def HAL(haltype,params...) * @def HAL(haltype,params...)
* @brief Defines VPIN mapping for specific hardware drivers * @brief Defines VPIN mapping for specific hardware drivers
* @param haltype driver name, normally device type * @param haltype driver name, normally device type
* @param params... depend on driver * @param params... depend on driver.
*/ */
#define HAL(haltype,params...) #define HAL(haltype,params...)
/** /**
* @def HAL_IGNORE_DEFAULTS * @def HAL_IGNORE_DEFAULTS
* @brief System will ignore default HAL settings * @brief System will ignore default HAL device mappings
*/ */
#define HAL_IGNORE_DEFAULTS #define HAL_IGNORE_DEFAULTS
/** /**
* @def IF(sensor_id) * @def IF(vpin)
* @brief Checks sensor state, If false jumps to matching nested ELSE or ENDIF * @brief Checks sensor state, If false jumps to matching nested ELSE or ENDIF
* @param sensor_id VPIN of sensor. Negative VPIM will invert sensor state. * @param vpin VPIN of sensor. Negative VPIN will invert sensor state.
*/ */
#define IF(sensor_id) #define IF(vpin)
/** /**
* @def IFAMBER(signal_id) * @def IFAMBER(signal_id)
* @brief Checks if signal is in AMBER state. * @brief Checks if signal is in AMBER state.
@ -557,13 +549,13 @@
*/ */
#define IFGREEN(signal_id) #define IFGREEN(signal_id)
/** /**
* @def IFGTE(sensor_id,value) * @def IFGTE(vpin,value)
* @brief Checks if analog sensor >= value * @brief Checks if analog vpin sensor >= value
* @see IF * @see IF
* @param sensor_id * @param vpin
* @param value * @param value
*/ */
#define IFGTE(sensor_id,value) #define IFGTE(vpin,value)
/** /**
* @def IFLOCO(loco_id) * @def IFLOCO(loco_id)
* @brief Checks if current task loco = loco_id * @brief Checks if current task loco = loco_id
@ -575,17 +567,17 @@
* @def IFLT(sensor_id,value) * @def IFLT(sensor_id,value)
* @brief Checks if analog sensor < value * @brief Checks if analog sensor < value
* @see IF * @see IF
* @param sensor_id * @param vpin Analog vpin of sensor
* @param value * @param value
*/ */
#define IFLT(sensor_id,value) #define IFLT(vpin,value)
/** /**
* @def IFNOT(sensor_id) * @def IFNOT(vpin)
* @brief Inverse of IF * @brief Inverse of IF
* @see IF * @see IF
* @param sensor_id * @param vpin
*/ */
#define IFNOT(sensor_id) #define IFNOT(vpin)
/** /**
* @def IFRANDOM(percent) * @def IFRANDOM(percent)
* @brief randomly satisfield IF at given percent probability * @brief randomly satisfield IF at given percent probability
@ -608,21 +600,21 @@
*/ */
#define IFTHROWN(turnout_id) #define IFTHROWN(turnout_id)
/** /**
* @def IFRESERVE(block) * @def IFRESERVE(token_id)
* @brief Agttempts to reserve block token and if satisfiled the block remains reserved. * @brief Attempts to reserve token and if satisfiled the token remains reserved.
* @see IF * @see IF RESERVE FREE
* @param block * @param token_id
*/ */
#define IFRESERVE(block) #define IFRESERVE(token_id)
/** /**
* @def IFTIMEOUT * @def IFTIMEOUT
* @brief Checks TIMEOUT state after an AT/AFTER request with timeout value. * @brief Checks TIMEOUT state after an AT/AFTER request with timeout value.
* @see IF * @see IF AT AFTER
*/ */
#define IFTIMEOUT #define IFTIMEOUT
/** /**
* @def IFTTPOSITION(turntable_id,position) * @def IFTTPOSITION(turntable_id,position)
* @brief Checks if GTurntable is in given position * @brief Checks if Turntable is in given position
* @see IF * @see IF
* @param turntable_id * @param turntable_id
* @param position * @param position
@ -643,7 +635,7 @@
/** /**
* @def JMRI_SENSOR(vpin,count...) * @def JMRI_SENSOR(vpin,count...)
* @brief DEfines multiple JMRI <s> type sensor feedback definitions each with id matching vpin * @brief DEfines multiple JMRI <s> type sensor feedback definitions each with id matching vpin
* @param vpin * @param vpin first vpin number
* @param count... Number of consecutine VPINS for which to create JMRI sensor feedbacks. Default 1. * @param count... Number of consecutine VPINS for which to create JMRI sensor feedbacks. Default 1.
*/ */
#define JMRI_SENSOR(vpin,count...) #define JMRI_SENSOR(vpin,count...)
@ -658,11 +650,11 @@
*/ */
#define KILLALL #define KILLALL
/** /**
* @def LATCH(sensor_id) * @def LATCH(vpin)
* @brief Make all AT/AFTER/IF see sensor active without checking hardware * @brief Make all AT/AFTER/IF see vpin as HIGH without checking hardware
* @param sensor_id Must only be for VPINS 0..255 * @param vpin Must only be for VPINS 0..255
*/ */
#define LATCH(sensor_id) #define LATCH(vpin)
/** /**
* @def LCC(eventid) * @def LCC(eventid)
* @brief Issue event to LCC * @brief Issue event to LCC
@ -714,25 +706,25 @@
*/ */
#define MOVETT(id,steps,activity) #define MOVETT(id,steps,activity)
/** /**
* @def NEOPIXEL(id,r,g,b,count...) * @def NEOPIXEL(vpin,r,g,b,count...)
* @brief Set a NEOPIXEL vpin to a given red/green/blue colour * @brief Set a NEOPIXEL vpin to a given red/green/blue colour
* @param id VPIN of a pixel * @param vpin VPIN of a pixel
* @param r red component 0-255 * @param r red component 0-255
* @param g green component 0-255 * @param g green component 0-255
* @param b blue component 0-255 * @param b blue component 0-255
* @param count... Number of consecutive pixels to set, Default 1. * @param count... Number of consecutive pixels to set, Default 1.
*/ */
#define NEOPIXEL(id,r,g,b,count...) #define NEOPIXEL(vpin,r,g,b,count...)
/** /**
* @def NEOPIXEL_SIGNAL(sigid,redcolour,ambercolour,greencolour) * @def NEOPIXEL_SIGNAL(signal_id,redcolour,ambercolour,greencolour)
* @brief Define a signal that uses a single multi colour pixel * @brief Define a signal that uses a single multi colour pixel
* @param sigid unique signal id * @see NEORGB
* @param redcolour RGB colour * @param vpin unique signal_id
* @param redcolour RGB colour use NEORGB(red,green,blue) to create values.
* @param ambercolour * @param ambercolour
* @param greencolour * @param greencolour
* Use NeoRGB(red,green,blue) to create values for redcolour etc above.
*/ */
#define NEOPIXEL_SIGNAL(sigid,redcolour,ambercolour,greencolour) #define NEOPIXEL_SIGNAL(vpin,redcolour,ambercolour,greencolour)
/** /**
* @def ACON(eventid) * @def ACON(eventid)
* @brief Send MERG CBUS ACON to Adapter * @brief Send MERG CBUS ACON to Adapter
@ -777,11 +769,11 @@
*/ */
#define ONAMBER(signal_id) #define ONAMBER(signal_id)
/** /**
* @def ONTIME(value) * @def ONTIME(minute_in_day)
* @brief Start task here when fastclock mins in day=value * @brief Start task here when fastclock matches
* @param value * @param minute_in_date (0..1439)
*/ */
#define ONTIME(value) #define ONTIME(minute_in_day)
/** /**
* @def ONCLOCKTIME(hours,mins) * @def ONCLOCKTIME(hours,mins)
* @brief Start task here when fastclock matches time * @brief Start task here when fastclock matches time