Move fix_mul to header.
[bertos.git] / bertos / algo / ramp.h
index f438dc5ebe1d7574566f85a16af5503731b745f5..b1fe716fba0104c3f141355449aea2367a5bb08f 100644 (file)
  */
 #define FREQ2MICROS(hz) (1000000UL / ((uint32_t)(hz)))
 
-
+/**
+ * Multiply \p a and \p b two integer at 32 bit and extract the high 16 bit word.
+ */
+#define FIX_MULT32(a,b)  (((uint64_t)(a)*(uint32_t)(b)) >> 16)
 
 /**
  * Structure holding pre-calculated data for speeding up real-time evaluation