Загрузка данных


/**
 * @brief Zephyr-compatible wrapper mirroring the Linux kernel do_div() macro behavior.
 * 
 * In Linux, do_div(n, base) mathematically modifies the dividend 'n' in-place 
 * (assigning it the quotient result of n / base) and returns the remainder value.
 * This macro uses a safe temporary variable block to strictly preserve that logical side-effect.
 */
#define do_div(n, base) ({                               \
	uint32_t __base = (base);                        \
	uint32_t __rem = (uint32_t)((n) % __base);       \
	(n) = (n) / __base;                              \
	__rem;                                           \
})