# HG changeset patch # User Florian Pose # Date 1271706766 -7200 # Node ID 2fadf016d9bed0b3d18e62ae41edb673ef83e142 # Parent 5b526d0f5a5d16550109c899c83070eab0cb8f78 Moved ABS() macro to globals. diff -r 5b526d0f5a5d -r 2fadf016d9be master/fsm_slave_config.c --- a/master/fsm_slave_config.c Mon Apr 19 21:51:01 2010 +0200 +++ b/master/fsm_slave_config.c Mon Apr 19 21:52:46 2010 +0200 @@ -416,8 +416,6 @@ /*****************************************************************************/ -#define ABS(X) ((X) >= 0 ? (X) : -(X)) - /** Configure 32 bit time offset. */ u64 ec_fsm_slave_config_dc_offset32( @@ -445,7 +443,7 @@ slave->ring_position, system_time32, correction, (u32) slave->master->app_time, time_diff); - if (ABS(time_diff) > EC_SYSTEM_TIME_TOLERANCE_NS) { + if (EC_ABS(time_diff) > EC_SYSTEM_TIME_TOLERANCE_NS) { new_offset = time_diff + old_offset32; if (slave->master->debug_level) EC_DBG("Slave %u: Setting time offset to %u (was %u)\n", @@ -486,7 +484,7 @@ slave->master->app_time, time_diff); - if (ABS(time_diff) > EC_SYSTEM_TIME_TOLERANCE_NS) { + if (EC_ABS(time_diff) > EC_SYSTEM_TIME_TOLERANCE_NS) { new_offset = time_diff + old_offset; if (slave->master->debug_level) EC_DBG("Slave %u: Setting time offset to %llu (was %llu)\n", diff -r 5b526d0f5a5d -r 2fadf016d9be master/globals.h --- a/master/globals.h Mon Apr 19 21:51:01 2010 +0200 +++ b/master/globals.h Mon Apr 19 21:52:46 2010 +0200 @@ -260,6 +260,12 @@ /*****************************************************************************/ +/** Absolute value. + */ +#define EC_ABS(X) ((X) >= 0 ? (X) : -(X)) + +/*****************************************************************************/ + extern char *ec_master_version_str; /*****************************************************************************/