/* Overwrite current step count. WARNING: This function writes to DMP memory and could potentially encounter a race condition if called while the pedometer is enabled.  */
int dmp_set_pedometer_step_count(unsigned long count)
/* Overwrite current step count. WARNING: This function writes to DMP memory and could potentially encounter a race condition if called while the pedometer is enabled.  */
int dmp_set_pedometer_step_count(unsigned long count)
{
    unsigned char tmp[4];
    tmp[0] = (unsigned char)((count >> 24) & 0xFF);
    tmp[1] = (unsigned char)((count >> 16) & 0xFF);
    tmp[2] = (unsigned char)((count >> 8) & 0xFF);
    tmp[3] = (unsigned char)(count & 0xFF);
    return mpu_write_mem(D_PEDSTD_STEPCTR, 4, tmp);
}