/Zephyr-latest/tests/boards/native_sim/rtc/src/ |
D | main.c | 28 hour = (time / 3600U / 1000000U) % 24; in us_time_to_str() 29 minute = (time / 60U / 1000000U) % 60; in us_time_to_str() 30 second = (time / 1000000U) % 60; in us_time_to_str() 33 sprintf(dest, "%02u:%02u:%02u.%06u", hour, minute, second, us); in us_time_to_str() 43 #define TICK_MS (1000ul / CONFIG_SYS_CLOCK_TICKS_PER_SEC) 92 error = diff / 1000 - WAIT_TIME / acc_ratio; in ZTEST() 111 error = diff - WAIT_TIME * 1000; in ZTEST() 119 error /= 1000; in ZTEST() 126 zassert_true(diff == WAIT_TIME * 1000, in ZTEST() 132 zassert_true(diff == WAIT_TIME * 1000, in ZTEST() [all …]
|
/Zephyr-latest/drivers/gnss/ |
D | gnss_dump.c | 85 const char *fmt = "gnss_info: {satellites_cnt: %u, hdop: %u.%u, fix_status: %s, " in gnss_dump_info() 88 ret = snprintk(str, strsize, fmt, info->satellites_cnt, info->hdop / 1000, in gnss_dump_info() 89 info->hdop % 1000, gnss_fix_status_to_str(info->fix_status), in gnss_dump_info() 99 "bearing %u.%03u, speed %u.%03u, altitude: %s%i.%03i}"; in gnss_dump_nav_data() 111 nav_data->bearing / 1000, nav_data->bearing % 1000, in gnss_dump_nav_data() 112 nav_data->speed / 1000, nav_data->speed % 1000, in gnss_dump_nav_data() 113 alt_sign, abs(nav_data->altitude) / 1000, abs(nav_data->altitude) % 1000); in gnss_dump_nav_data() 121 const char *fmt = "gnss_time: {hour: %u, minute: %u, millisecond %u, month_day %u, " in gnss_dump_time() 122 "month: %u, century_year: %u}"; in gnss_dump_time() 134 const char *fmt = "gnss_satellite: {prn: %u, snr: %u, elevation %u, azimuth %u, " in gnss_dump_satellite() [all …]
|
/Zephyr-latest/samples/boards/nxp/mimxrt1060_evk/system_off/src/ |
D | main.c | 15 #define BUSY_WAIT_S 2U 16 #define SLEEP_S 2U 17 #define SOFT_OFF_S 10U 60 printk("Busy-wait %u s\n", BUSY_WAIT_S); in main() 63 printk("Sleep %u s\n", SLEEP_S); in main() 66 uint32_t sleep_ticks = counter_us_to_ticks(snvs_rtc_dev, SOFT_OFF_S * 1000ULL * 1000ULL); in main() 84 counter_ticks_to_us(snvs_rtc_dev, alarm_cfg.ticks) / (1000ULL * 1000ULL)); in main() 87 pm_state_force(0u, &(struct pm_state_info){ PM_STATE_SOFT_OFF, 0, 0 }); in main()
|
/Zephyr-latest/drivers/pwm/ |
D | pwm_b91.c | 31 pwm_clk_div = sys_clk.pclk * 1000 * 1000 / config->clock_frequency - 1; in pwm_b91_init() 103 if ((config->clk32k_ch_enable & BIT(channel)) != 0U) { in pwm_b91_get_cycles_per_sec() 104 *cycles = 32000u; in pwm_b91_get_cycles_per_sec() 106 *cycles = sys_clk.pclk * 1000 * 1000 / (reg_pwm_clkdiv + 1); in pwm_b91_get_cycles_per_sec() 127 ((DT_INST_PROP(n, clk32k_ch0_enable) << 0U) | \ 128 (DT_INST_PROP(n, clk32k_ch1_enable) << 1U) | \ 129 (DT_INST_PROP(n, clk32k_ch2_enable) << 2U) | \ 130 (DT_INST_PROP(n, clk32k_ch3_enable) << 3U) | \ 131 (DT_INST_PROP(n, clk32k_ch4_enable) << 4U) | \ 132 (DT_INST_PROP(n, clk32k_ch5_enable) << 5U)), \
|
/Zephyr-latest/drivers/sensor/maxim/max44009/ |
D | max44009.c | 59 uint8_t old_val = 0U; in max44009_reg_update() 60 uint8_t new_val = 0U; in max44009_reg_update() 87 cr = val->val1 * 1000 + val->val2 / 1000; in max44009_attr_set() 92 value = 0U; in max44009_attr_set() 122 drv_data->sample = 0U; in max44009_sample_fetch() 162 val->val1 = (uval * 45U) / 1000; in max44009_channel_get() 163 val->val2 = ((uval * 45U) % 1000) * 1000U; in max44009_channel_get()
|
/Zephyr-latest/tests/kernel/timer/timer_behavior/src/ |
D | tick_timer_train.c | 67 const uint32_t max_time = TEST_SECONDS*1000 + 1000; in ZTEST() 69 TC_PRINT("Initializing %u Timers, Tick Rate %uHz, Expecting %u callbacks in %u ms\n", in ZTEST() 105 TC_PRINT("Faking busy work, remaining timers is %u, timer callbacks %u\n", in ZTEST() 124 TC_PRINT("One Tick Timer Train Done, took %u ms, busy loop ran %u times\n", in ZTEST() 129 TC_PRINT(" Perfect delta %u cycles or %u us\n", in ZTEST() 132 TC_PRINT("Timer %d max delta %u cycles or %u us, " in ZTEST() 133 "%u late callbacks (%u.%u%%)\n", in ZTEST() 137 (1000 * timers[i].late_callbacks + MAX_CALLBACKS/2) / MAX_CALLBACKS / 10, in ZTEST() 138 (1000 * timers[i].late_callbacks + MAX_CALLBACKS/2) / MAX_CALLBACKS % 10); in ZTEST() 142 ", \"timer\":%d, \"max_delta_cycles\":%u, \"max_delta_us\":%u" in ZTEST() [all …]
|
/Zephyr-latest/drivers/sensor/nordic/npm1300_charger/ |
D | npm1300_charger.c | 23 int32_t temp_thresholds[4U]; 24 int32_t dietemp_thresholds[2U]; 106 #define ADC_MSB_SHIFT 2U 108 #define ADC_LSB_VBAT_SHIFT 0U 109 #define ADC_LSB_NTC_SHIFT 2U 110 #define ADC_LSB_DIE_SHIFT 4U 111 #define ADC_LSB_IBAT_SHIFT 4U 114 #define NTCTEMP_MSB_SHIFT 2U 118 #define DIETEMP_MSB_SHIFT 2U 141 LINEAR_RANGE_INIT(3500000, 50000, 0U, 3U), LINEAR_RANGE_INIT(4000000, 50000, 4U, 13U)}; [all …]
|
/Zephyr-latest/tests/drivers/regulator/fixed/src/ |
D | main.c | 16 startup_delay_us) / 1000U; 18 off_on_delay_us) / 1000U;
|
/Zephyr-latest/tests/subsys/fs/littlefs/src/ |
D | test_lfs_perf.c | 61 TC_PRINT("read_size %u ; prog_size %u ; cache_size %u ; lookahead_size %u\n", in write_read() 114 TC_PRINT("%s write %zu * %zu = %zu bytes in %u ms: " in write_read() 115 "%u By/s, %u KiBy/s\n", in write_read() 117 (uint32_t)(total * 1000U / (t1 - t0)), in write_read() 118 (uint32_t)(total * 1000U / (t1 - t0) / 1024U)); in write_read() 140 TC_PRINT("%s read %zu * %zu = %zu bytes in %u ms: " in write_read() 141 "%u By/s, %u KiBy/s\n", in write_read() 143 (uint32_t)(total * 1000U / (t1 - t0)), in write_read() 144 (uint32_t)(total * 1000U / (t1 - t0) / 1024U)); in write_read()
|
/Zephyr-latest/subsys/logging/ |
D | log_output.c | 71 ret = 7U; in level_to_rfc5424_severity() 74 ret = 3U; in level_to_rfc5424_severity() 77 ret = 4U; in level_to_rfc5424_severity() 80 ret = 6U; in level_to_rfc5424_severity() 83 ret = 7U; in level_to_rfc5424_severity() 86 ret = 7U; in level_to_rfc5424_severity() 159 } else if (freq != 0U) { in timestamp_print() 173 ms = (remainder * 1000U) / freq; in timestamp_print() 174 us = (1000 * (remainder * 1000U - (ms * freq))) / freq; in timestamp_print() 188 time_str, ms * 1000U + us); in timestamp_print() [all …]
|
/Zephyr-latest/scripts/native_simulator/native/src/ |
D | native_rtc.c | 29 return sec * 1000000UL + nsec / 1000U; in native_rtc_gettime_us() 46 *nsec = (us % 1000000UL) * 1000U; in native_rtc_gettime()
|
/Zephyr-latest/boards/native/native_posix/ |
D | native_rtc.c | 31 return sec * 1000000UL + nsec / 1000U; in native_rtc_gettime_us() 48 *nsec = (us % 1000000UL) * 1000U; in native_rtc_gettime()
|
/Zephyr-latest/drivers/clock_control/ |
D | clock_control_agilex5_ll.c | 20 uint32_t arefclkdiv = 0U; in get_ref_clk() 21 uint32_t ref_clk = 0U; in get_ref_clk() 22 uint32_t mdiv = 0U; in get_ref_clk() 23 uint32_t pllglob_val = 0U; in get_ref_clk() 24 uint32_t pllm_val = 0U; in get_ref_clk() 63 LOG_DBG("%s: ref_clk %u\n", __func__, ref_clk); in get_ref_clk() 72 uint32_t clock_val = 0U; in get_clk_freq() 73 uint32_t clk_psrc = 0U; in get_clk_freq() 74 uint32_t pllcx_div = 0U; in get_clk_freq() 113 LOG_DBG("%s: clock source %lu and its value %u\n", in get_clk_freq() [all …]
|
/Zephyr-latest/tests/kernel/sched/schedule_api/src/ |
D | test_sched_timeslice_reset.c | 23 ((uint64_t)(HALF_SLICE_SIZE)*sys_clock_hw_cycles_per_sec() / 1000) 26 #if CONFIG_SYS_CLOCK_TICKS_PER_SEC >= 1000 31 #define TASK_SWITCH_TOLERANCE (1000 / CONFIG_SYS_CLOCK_TICKS_PER_SEC) 64 sys_clock_hw_cycles_per_sec() / 1000; in thread_time_slice() 67 sys_clock_hw_cycles_per_sec() / 1000; in thread_time_slice() 97 "timeslice too small, expected %u got %u", in thread_time_slice() 100 "timeslice too big, expected %u got %u", in thread_time_slice()
|
/Zephyr-latest/samples/drivers/peci/src/ |
D | main.c | 18 #define PECI_HOST_BITRATE 1000u 20 #define PECI_CONFIGINDEX_TJMAX 16u 21 #define PECI_CONFIGHOSTID 0u 22 #define PECI_CONFIGPARAM 0u 163 printk("Maximum temperature: %u\n", cpu_tjmax); in get_max_temp() 170 k_sleep(K_MSEC(1000)); in monitor_temperature_func() 192 ret = peci_config(peci_dev, 1000u); in main()
|
/Zephyr-latest/subsys/net/lib/zperf/ |
D | zperf_shell.c | 77 const uint32_t TIME_US[] = { 60 * 1000 * 1000, 1000 * 1000, 1000, 0 }; 79 const uint32_t KBPS[] = { 1000, 0 }; 81 const uint32_t K[] = { 1000 * 1000, 1000, 0 }; 99 if (*divisor != 0U) { in print_number() 101 dec = (value % *divisor) * 100U / *divisor; in print_number() 102 shell_fprintf(sh, SHELL_NORMAL, "%u.%s%u %s", radix, in print_number() 105 shell_fprintf(sh, SHELL_NORMAL, "%u %s", value, *unit); in print_number() 125 if (*divisor != 0U) { in print_number_64() 127 dec = (value % *divisor) * 100U / *divisor; in print_number_64() 128 shell_fprintf(sh, SHELL_NORMAL, "%llu.%s%u %s", radix, in print_number_64() [all …]
|
/Zephyr-latest/tests/drivers/regulator/voltage/src/ |
D | main.c | 46 for (size_t i = 0U; i < ARRAY_SIZE(regs); i++) { in ZTEST() 55 zassume_not_equal(volt_cnt, 0U); in ZTEST() 57 TC_PRINT("Testing %s, %u voltage/s (tolerance: %d uV)\n", in ZTEST() 63 for (unsigned int j = 0U; j < volt_cnt; j++) { in ZTEST() 85 for (unsigned int k = 0U; k < adc_avg_count; k++) { in ZTEST() 98 val_mv * 1000); in ZTEST() 100 zassert_between_inclusive(val_mv * 1000, in ZTEST() 115 for (size_t i = 0U; i < ARRAY_SIZE(regs); i++) { in setup()
|
/Zephyr-latest/samples/sensor/adt7420/src/ |
D | main.c | 17 #define UCEL_PER_MCEL 1000 32 s = now % 60U; in now_str() 33 now /= 60U; in now_str() 34 min = now % 60U; in now_str() 35 now /= 60U; in now_str() 38 snprintf(buf, sizeof(buf), "%u:%02u:%02u.%03u", in now_str() 109 SENSOR_ATTR_SAMPLING_FREQUENCY, 240 * 1000); in process()
|
/Zephyr-latest/tests/kernel/timer/timer_monotonic/src/ |
D | main.c | 19 k_sleep(K_MSEC(1000)); in test_frequency() 23 pct = (uint64_t)delta * 100U / sys_clock_hw_cycles_per_sec(); in test_frequency() 25 printk("delta: %u expected: %u %u%%\n", delta, in test_frequency() 57 errors = 0U; in ZTEST() 66 for (i = 0U; i < 1000000; i++) { in ZTEST() 71 TC_PRINT("diff = %d (t_last = %u : t_now = %u);" in ZTEST() 72 "i = %u\n", diff, t_last, t_now, i); in ZTEST()
|
/Zephyr-latest/drivers/led/ |
D | pca9633.c | 77 gdc = delay_on * 256U / period; in pca9633_led_blink() 88 * So, period (in ms) = (((GFRQ + 1) / 24) * 1000) -> in pca9633_led_blink() 89 * GFRQ = ((period * 24 / 1000) - 1) in pca9633_led_blink() 91 gfrq = (period * 24U / 1000) - 1; in pca9633_led_blink() 134 val = (value * 255U) / dev_data->max_brightness; in pca9633_led_set_brightness() 211 dev_data->min_period = 41U; in pca9633_led_init() 212 dev_data->max_period = 10667U; in pca9633_led_init() 213 dev_data->min_brightness = 0U; in pca9633_led_init() 214 dev_data->max_brightness = 100U; in pca9633_led_init()
|
D | tlc59108.c | 108 gdc = delay_on * 256U / period; in tlc59108_led_blink() 117 * So, period (in ms) = (((GFRQ + 1) / 24) * 1000) -> in tlc59108_led_blink() 118 * GFRQ = ((period * 24 / 1000) - 1) in tlc59108_led_blink() 120 gfrq = (period * 24U / 1000) - 1; in tlc59108_led_blink() 155 val = (value * 255U) / dev_data->max_brightness; in tlc59108_led_set_brightness() 203 dev_data->min_period = 41U; in tlc59108_led_init() 204 dev_data->max_period = 10730U; in tlc59108_led_init() 205 dev_data->min_brightness = 0U; in tlc59108_led_init() 206 dev_data->max_brightness = 100U; in tlc59108_led_init()
|
/Zephyr-latest/tests/subsys/settings/file/src/ |
D | settings_test_save_one_file.c | 27 cf.cf_maxlines = 1000; in ZTEST() 36 val8 = 33U; in ZTEST() 45 zassert_true(val8 == 42U, "bad value read"); in ZTEST() 52 zassert_true(val8 == 44U, "bad value read"); in ZTEST()
|
/Zephyr-latest/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/ |
D | radio_nrf5.h | 19 #define HAL_RADIO_NS2US_CEIL(ns) ((ns + 999)/1000) 20 #define HAL_RADIO_NS2US_ROUND(ns) ((ns + 500)/1000) 108 #define HAL_RADIO_TMR_START_DELAY_US 1U 110 #define HAL_RADIO_TMR_START_DELAY_US 0U 114 #define HAL_RADIO_TMR_DEFERRED_TX_DELAY_US 50U
|
/Zephyr-latest/samples/boards/microchip/mec15xxevb_assy6853/power_management/src/ |
D | power_mgmt.c | 23 #define THREAD_B_SLEEP_TIME 1000ul 32 #define SEC_TO_MSEC 1000ul 286 k_msleep((residency_info[0].min_residency_us / 1000U) + in test_pwr_mgmt_multithread() 308 1000U) + DP_EXTRA_SLP_TIME); in test_pwr_mgmt_multithread() 345 k_msleep((residency_info[0].min_residency_us / 1000U) + in test_pwr_mgmt_singlethread() 362 1000U) + DP_EXTRA_SLP_TIME); in test_pwr_mgmt_singlethread()
|
/Zephyr-latest/tests/ztest/ztress/src/ |
D | main.c | 16 for (int i = 0; i < 1000; i++) { in ztress_handler_busy() 32 int timeout = 1000; in ZTEST() 40 ZTRESS_THREAD(ztress_handler_busy, NULL, repeat, 1000, t)); in ZTEST() 43 zassert_within(d, 1000, 200); in ZTEST() 49 ZTRESS_CONTEXT_INITIALIZER(ztress_handler_busy, NULL, repeat, 1000, t), in ZTEST() 50 ZTRESS_CONTEXT_INITIALIZER(ztress_handler_busy, NULL, repeat, 1000, t) in ZTEST() 120 zassert_true(exec_cnt >= repeat && exec_cnt < repeat + 10, "exec_cnt: %u", exec_cnt); in ZTEST() 145 ZTRESS_CONTEXT_INITIALIZER(ztress_handler_busy, NULL, repeat, 1000, t), in ZTEST() 146 ZTRESS_CONTEXT_INITIALIZER(ztress_handler_busy, NULL, repeat, 1000, t), in ZTEST() 147 ZTRESS_CONTEXT_INITIALIZER(ztress_handler_busy, NULL, repeat, 1000, t) in ZTEST()
|