X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Falgo%2Framp.h;h=b1fe716fba0104c3f141355449aea2367a5bb08f;hb=d3774c5c1c4ebb4710773627068be0ad39a479e3;hp=f438dc5ebe1d7574566f85a16af5503731b745f5;hpb=791e167e053bdd9250d34a9a5ccae6ccde4d6679;p=bertos.git diff --git a/bertos/algo/ramp.h b/bertos/algo/ramp.h index f438dc5e..b1fe716f 100644 --- a/bertos/algo/ramp.h +++ b/bertos/algo/ramp.h @@ -114,7 +114,10 @@ */ #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