Error functions in ADCs

Within an ADC sys_error(),sys_fail() and dp4_halt() are replaced by calls which set information in the parameter block and do a long jump to get out of the ADC and return to the calling program.

You therefore need to consider the following points:

  1. You should make sure that if your ADC calls DP4 C library functions which could cause a system error to be generated, that these calls are not made in places where jumping out of your current context could leave a mess (for example linked lists which are in the middle of being updated).

  2. If you write a multi-threaded ADC or have some other pathway into your ADC you run the risk of getting into a state where a sys_error() causes a long jump into a destroyed stack context.

DP4 Networking program and SRVn itself replace sys_error() in a similar way, and have had bugs of these types in the past.