/Zephyr-latest/samples/kernel/condition_variables/condvar/ |
D | README.rst | 1 .. zephyr:code-sample:: kernel-condvar 3 :relevant-api: condvar_apis 25 .. zephyr-app-commands:: 26 :zephyr-app: samples/kernel/condition_variables/condvar 27 :host-os: unix 37 .. code-block:: console 40 watch_count: thread 1 Count= 0. Going into wait... 41 inc_count: thread 2, count = 1, unlocking mutex 42 inc_count: thread 3, count = 2, unlocking mutex 43 inc_count: thread 2, count = 3, unlocking mutex [all …]
|
/Zephyr-latest/subsys/net/lib/prometheus/ |
D | summary.c | 4 * SPDX-License-Identifier: Apache-2.0 20 return -EINVAL; in prometheus_summary_observe() 23 /* increment count */ in prometheus_summary_observe() 24 summary->count++; in prometheus_summary_observe() 27 summary->sum += value; in prometheus_summary_observe() 33 double value, unsigned long count) in prometheus_summary_observe_set() argument 39 return -EINVAL; in prometheus_summary_observe_set() 42 if (value == summary->sum && count == summary->count) { in prometheus_summary_observe_set() 46 old_count = summary->count; in prometheus_summary_observe_set() 47 if (count < old_count) { in prometheus_summary_observe_set() [all …]
|
D | histogram.c | 4 * SPDX-License-Identifier: Apache-2.0 20 return -EINVAL; in prometheus_histogram_observe() 23 /* increment count */ in prometheus_histogram_observe() 24 histogram->count++; in prometheus_histogram_observe() 27 histogram->sum += value; in prometheus_histogram_observe() 30 for (size_t i = 0; i < histogram->num_buckets; ++i) { in prometheus_histogram_observe() 31 if (value <= histogram->buckets[i].upper_bound) { in prometheus_histogram_observe() 32 /* increment count for the bucket */ in prometheus_histogram_observe() 33 histogram->buckets[i].count++; in prometheus_histogram_observe() 35 LOG_DBG("value: %f, bucket: %f, count: %lu", value, in prometheus_histogram_observe() [all …]
|
/Zephyr-latest/tests/kernel/obj_tracking/src/ |
D | main.c | 4 * SPDX-License-Identifier: Apache-2.0 43 int count; in ZTEST() local 46 count = 0; in ZTEST() 50 count++; in ZTEST() 54 zassert_equal(count, 2, "Wrong number of timer objects"); in ZTEST() 57 count = 0; in ZTEST() 61 count++; in ZTEST() 65 zassert_equal(count, 2, "Wrong number of mem_slab objects"); in ZTEST() 68 count = 0; in ZTEST() 72 count++; in ZTEST() [all …]
|
/Zephyr-latest/samples/drivers/misc/timeaware_gpio/ |
D | README.rst | 1 .. zephyr:code-sample:: timeaware-gpio 2 :name: Time-aware GPIO 3 :relevant-api: tgpio_interface 21 .. zephyr-app-commands:: 22 :zephyr-app: samples/drivers/misc/timeaware_gpio 24 :host-os: unix 34 .. code-block:: console 36 *** Booting Zephyr OS build zephyr-v3.4.0-4166-g52b34a310c67 *** 41 [TGPIO] timestamp: 0000000000000000, event count: 0000000000000000 42 [TGPIO] timestamp: 0000000148a3cf31, event count: 0000000000000001 [all …]
|
/Zephyr-latest/samples/kernel/condition_variables/condvar/src/ |
D | main.c | 4 * SPDX-License-Identifier: Apache-2.0 13 static int count; variable 31 count++; in inc_count() 34 * Check the value of count and signal waiting thread when in inc_count() 39 if (count == COUNT_LIMIT) { in inc_count() 40 printk("%s: thread %ld, count = %d Threshold reached.", in inc_count() 41 __func__, my_id, count); in inc_count() 45 printk("%s: thread %ld, count = %d, unlocking mutex\n", in inc_count() 46 __func__, my_id, count); in inc_count() 61 while (count < COUNT_LIMIT) { in watch_count() [all …]
|
/Zephyr-latest/tests/bluetooth/host/id/bt_id_get/src/ |
D | main.c | 4 * SPDX-License-Identifier: Apache-2.0 49 * Get currently stored ID count 52 * - Use NULL value for the address 55 * - Count parameter pointer is dereferenced and loaded with the current bt_dev.id_count 59 size_t count; in ZTEST() local 61 bt_id_get(NULL, &count); in ZTEST() 63 zassert_equal(count, CONFIG_BT_ID_MAX, "Incorrect ID count %d was returned", count); in ZTEST() 70 * - Destination array is initially cleared 73 * - Count parameter pointer is dereferenced and loaded with actual number of copied items 81 size_t count = testing_counts[it]; in ZTEST() local [all …]
|
/Zephyr-latest/tests/kernel/common/src/ |
D | printk.c | 4 * SPDX-License-Identifier: Apache-2.0 8 #include <zephyr/sys/printk-hooks.h> 59 "p 112 -10000 -32768 -40000 -22\n" 64 "-42 -42 -42 -42\n" 69 "68719476735 -1 18446744073709551615 ffffffffffffffff\n" 71 "-1 -1 4294967295 ffffffff\n" 77 "-42 -42 -042 -0000042\n" 82 "68719476735 -1 18446744073709551615 ffffffffffffffff\n" 84 "-1 -1 4294967295 ffffffff\n" 91 "p 112 -10000 -32768 -40000 -22\n" [all …]
|
/Zephyr-latest/tests/benchmarks/data_structure_perf/dlist_perf/src/ |
D | dlist_perf.c | 4 * SPDX-License-Identifier: Apache-2.0 8 * @brief doubly-linked list tests 30 * dlist node.Appending nodes into the doubly-linked list 31 * and enumerate the doubly-linked list. 44 int i, count; in ZTEST() local 47 /* Initialize an user-defiend structure of contains dlist node */ in ZTEST() 60 /* Add into a doubly-linked list */ in ZTEST() 65 /* Enumerate the doubly-linked list */ in ZTEST() 66 count = 0; in ZTEST() 68 zassert_true(cnode->value == count, in ZTEST() [all …]
|
/Zephyr-latest/tests/drivers/mm/sys_mm_drv_bank/src/ |
D | main.c | 4 * SPDX-License-Identifier: Apache-2.0 20 zassert_equal(stats->free_bytes, expected->free_bytes, in test_stats() 22 stats->free_bytes, expected->free_bytes); in test_stats() 23 zassert_equal(stats->allocated_bytes, expected->allocated_bytes, in test_stats() 25 stats->allocated_bytes, expected->allocated_bytes); in test_stats() 26 zassert_equal(stats->max_allocated_bytes, expected->max_allocated_bytes, in test_stats() 28 stats->max_allocated_bytes, in test_stats() 29 expected->max_allocated_bytes); in test_stats() 36 uint32_t count; in ZTEST() local 61 count = sys_mm_drv_bank_page_mapped(&bank_data); in ZTEST() [all …]
|
/Zephyr-latest/tests/posix/eventfd/src/ |
D | stress.c | 4 * SPDX-License-Identifier: Apache-2.0 25 static size_t count[2]; variable 68 ret = op[id](fixture->fd); in th_fun() 70 zassert_true(ret == 0 || (ret == -1 && errno == EAGAIN), in th_fun() 73 count[id] += (ret == 0); in th_fun() 77 printk("%zu %s\n", count[id], msg[id]); in th_fun() 84 printk("avg: %zu %s/s\n", (size_t)((count[id] * MSEC_PER_SEC) / end_ms), msg[id]); in th_fun() 97 reopen(&fixture->fd, 0, EFD_NONBLOCK | EFD_SEMAPHORE); in ZTEST_F() 109 zassert_true(count[READER] > 0, "read count is zero"); in ZTEST_F() 110 zassert_true(count[WRITER] > 0, "write count is zero"); in ZTEST_F() [all …]
|
/Zephyr-latest/lib/mem_blocks/ |
D | mem_blocks.c | 4 * SPDX-License-Identifier: Apache-2.0 23 k_spinlock_key_t key = k_spin_lock(&mem_block->lock); in alloc_blocks() 27 r = sys_bitarray_alloc(mem_block->bitmap, num_blocks, &offset); in alloc_blocks() 30 k_spin_unlock(&mem_block->lock, key); in alloc_blocks() 37 mem_block->info.used_blocks += (uint32_t)num_blocks; in alloc_blocks() 39 if (mem_block->info.max_used_blocks < mem_block->info.used_blocks) { in alloc_blocks() 40 mem_block->info.max_used_blocks = mem_block->info.used_blocks; in alloc_blocks() 43 k_spin_unlock(&mem_block->lock, key); in alloc_blocks() 48 blk = mem_block->buffer + (offset << mem_block->info.blk_sz_shift); in alloc_blocks() 61 if (blk < mem_block->buffer) { in free_blocks() [all …]
|
/Zephyr-latest/tests/benchmarks/latency_measure/src/ |
D | heap_malloc_free.c | 4 * SPDX-License-Identifier: Apache-2.0 22 uint32_t count = 0U; in heap_malloc_free() local 33 while (count != TEST_COUNT) { in heap_malloc_free() 41 "alloc memory @ iteration %d", count); in heap_malloc_free() 54 count++; in heap_malloc_free() 58 * If count is 0, it means that there is not enough memory heap in heap_malloc_free() 62 if (count == 0) { in heap_malloc_free() 64 notes = "Memory heap too small--increase it."; in heap_malloc_free() 68 "%-40s - Average time for heap malloc", in heap_malloc_free() 70 PRINT_STATS_AVG(description, sum_malloc, count, failed, notes); in heap_malloc_free() [all …]
|
/Zephyr-latest/subsys/sensing/ |
D | sensing.c | 4 * SPDX-License-Identifier: Apache-2.0 23 return -ENODEV; in sensing_open_sensor() 27 if (sensor_info == sensor->info) { in sensing_open_sensor() 30 return -EINVAL; in sensing_open_sensor() 47 return -ENODEV; in sensing_open_sensor_by_dt() 53 return -ENODEV; in sensing_open_sensor_by_dt() 58 return -EINVAL; in sensing_open_sensor_by_dt() 68 return -ENODEV; in sensing_close_sensor() 76 int count) in sensing_set_config() argument 82 return -ENODEV; in sensing_set_config() [all …]
|
/Zephyr-latest/scripts/native_simulator/native/src/ |
D | nsi_cmdline_common.c | 5 * SPDX-License-Identifier: Apache-2.0 24 * [-[-]]<option> 26 * [-[-]]<option>{:|=}<value> 38 if (arg[of] == '-') { in nsi_cmd_is_option() 41 if (arg[of] == '-') { in nsi_cmd_is_option() 71 "For example --ratio=3\n", in nsi_cmd_is_option() 81 * Valid help options are [-[-]]{?|h|help} 86 if (arg[0] == '-') { in nsi_cmd_is_help_option() 89 if (arg[0] == '-') { in nsi_cmd_is_help_option() 177 " --help for usage information\n", in nsi_cmd_read_option_value() [all …]
|
/Zephyr-latest/boards/native/native_posix/ |
D | cmdline_common.c | 4 * SPDX-License-Identifier: Apache-2.0 22 * [-[-]]<option> 24 * [-[-]]<option>{:|=}<value> 36 if (arg[of] == '-') { in cmd_is_option() 39 if (arg[of] == '-') { in cmd_is_option() 69 "For example --ratio=3\n", in cmd_is_option() 79 * Valid help options are [-[-]]{?|h|help} 84 if (arg[0] == '-') { in cmd_is_help_option() 87 if (arg[0] == '-') { in cmd_is_help_option() 175 " --help for usage information\n", in cmd_read_option_value() [all …]
|
/Zephyr-latest/tests/subsys/fs/common/ |
D | test_fs_util.c | 4 * SPDX-License-Identifier: Apache-2.0 17 const char *endp = pp->path + sizeof(pp->path); in path_vextend() 21 char *eos = pp->eos; in path_vextend() 22 size_t rem = (endp - eos); in path_vextend() 25 char *sp = strrchr(pp->path, '/'); in path_vextend() 27 if (sp == pp->path) { in path_vextend() 41 pp->eos = eos; in path_vextend() 45 return pp->path; in path_vextend() 55 pp->path[0] = '/'; in testfs_path_init() 56 pp->eos = pp->path + 1; in testfs_path_init() [all …]
|
/Zephyr-latest/samples/modules/thrift/hello/server/src/ |
D | HelloHandler.h | 4 * SPDX-License-Identifier: Apache-2.0 22 HelloHandler() : count(0) in HelloHandler() 39 ++count; in counter() 40 printk("%s: %d\n", __func__, count); in counter() 41 return count; in counter() 45 int count;
|
/Zephyr-latest/samples/boards/nordic/system_off/ |
D | sample.yaml | 8 - nrf52840dk/nrf52840 10 - nrf51dk/nrf51822 11 - nrf52840dk/nrf52840 12 - nrf52dk/nrf52832 13 - nrf5340dk/nrf5340/cpuapp 14 - nrf54l15dk/nrf54l05/cpuapp 15 - nrf54l15dk/nrf54l10/cpuapp 16 - nrf54l15dk/nrf54l15/cpuapp 17 - nrf54l20pdk/nrf54l20/cpuapp 23 - "system off demo" [all …]
|
/Zephyr-latest/subsys/net/lib/shell/ |
D | sockets.c | 4 * SPDX-License-Identifier: Apache-2.0 29 const struct shell *sh = data->sh; in walk_sockets() 30 struct socket_info *count = data->user_data; in walk_sockets() local 39 if (k_thread_name_copy(obj->creator, thread_name, in walk_sockets() 40 sizeof(thread_name) - 1) < 0) { in walk_sockets() 41 snprintk(thread_name, sizeof(thread_name) - 1, "%p", in walk_sockets() 42 obj->creator); in walk_sockets() 45 thread_name[sizeof(thread_name) - 1] = '\0'; in walk_sockets() 53 if (obj->fd < 0) { in walk_sockets() 57 lifetime = obj->create_time; in walk_sockets() [all …]
|
/Zephyr-latest/subsys/portability/cmsis_rtos_v2/ |
D | Kconfig | 2 # SPDX-License-Identifier: Apache-2.0 13 This enables CMSIS RTOS v2 API support. This is an OS-integration 19 int "Maximum thread count in CMSIS RTOS V2 application" 28 int "Maximum dynamic thread count in CMSIS RTOS V2 application" 35 threads i.e. they also count towards that maximum too. 52 int "Maximum timer count in CMSIS RTOS V2 application" 59 int "Maximum mutex count in CMSIS RTOS V2 application" 66 int "Maximum semaphore count in CMSIS RTOS V2 application" 73 int "Maximum mem slab count in CMSIS RTOS V2 application" 86 int "Maximum message queue count in CMSIS RTOS V2 application" [all …]
|
/Zephyr-latest/drivers/spi/ |
D | spi_handlers.c | 4 * SPDX-License-Identifier: Apache-2.0 20 if (bufs->count == 0) { in copy_and_check() 21 bufs->buffers = NULL; in copy_and_check() 26 K_OOPS(K_SYSCALL_MEMORY_ARRAY_READ(bufs->buffers, in copy_and_check() 27 bufs->count, in copy_and_check() 33 bufs->buffers = memcpy(buf_copy, in copy_and_check() 34 bufs->buffers, in copy_and_check() 35 bufs->count * sizeof(struct spi_buf)); in copy_and_check() 37 for (i = 0; i < bufs->count; i++) { in copy_and_check() 41 const struct spi_buf *buf = &bufs->buffers[i]; in copy_and_check() [all …]
|
/Zephyr-latest/drivers/bbram/ |
D | bbram_it8xxx2_emul.c | 3 * SPDX-License-Identifier: Apache-2.0 20 *)(((const struct bbram_it8xxx2_emul_config *)((target)->cfg))->dev->config)) 22 static int it8xxx2_emul_backend_set_data(const struct emul *target, size_t offset, size_t count, in it8xxx2_emul_backend_set_data() argument 27 if (offset + count > config->size) { in it8xxx2_emul_backend_set_data() 28 return -ERANGE; in it8xxx2_emul_backend_set_data() 31 bytecpy(((uint8_t *)config->base_addr + offset), buffer, count); in it8xxx2_emul_backend_set_data() 35 static int it8xxx2_emul_backend_get_data(const struct emul *target, size_t offset, size_t count, in it8xxx2_emul_backend_get_data() argument 40 if (offset + count > config->size) { in it8xxx2_emul_backend_get_data() 41 return -ERANGE; in it8xxx2_emul_backend_get_data() 44 bytecpy(buffer, ((uint8_t *)config->base_addr + offset), count); in it8xxx2_emul_backend_get_data()
|
D | bbram_npcx_emul.c | 3 * SPDX-License-Identifier: Apache-2.0 20 *)(((const struct bbram_npcx_emul_config *)((target)->cfg))->dev->config)) 22 static int npcx_emul_backend_set_data(const struct emul *target, size_t offset, size_t count, in npcx_emul_backend_set_data() argument 27 if (offset + count > config->size) { in npcx_emul_backend_set_data() 28 return -ERANGE; in npcx_emul_backend_set_data() 31 bytecpy(((uint8_t *)config->base_addr + offset), buffer, count); in npcx_emul_backend_set_data() 35 static int npcx_emul_backend_get_data(const struct emul *target, size_t offset, size_t count, in npcx_emul_backend_get_data() argument 40 if (offset + count > config->size) { in npcx_emul_backend_get_data() 41 return -ERANGE; in npcx_emul_backend_get_data() 44 bytecpy(buffer, ((uint8_t *)config->base_addr + offset), count); in npcx_emul_backend_get_data()
|
/Zephyr-latest/tests/subsys/logging/log_custom_header/src/ |
D | log_custom_header.c | 4 * SPDX-License-Identifier: Apache-2.0 21 static uint32_t count; variable 36 uint8_t *p = log_msg_get_package(&msg->log, &len); in backend_process() 42 count += 1; in backend_process() 53 zassert_equal(count, 0); in ZTEST() 57 zassert_equal(count, 1); in ZTEST() 62 zassert_equal(count, 2); in ZTEST() 67 zassert_equal(count, 3); in ZTEST() 72 zassert_equal(count, 4); in ZTEST() 84 count = 0; in before()
|