當前位置: 首頁>>代碼示例>>C++>>正文


C++ ARG_UNUSED函數代碼示例

本文整理匯總了C++中ARG_UNUSED函數的典型用法代碼示例。如果您正苦於以下問題:C++ ARG_UNUSED函數的具體用法?C++ ARG_UNUSED怎麽用?C++ ARG_UNUSED使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了ARG_UNUSED函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: test_fiber_pend_and_timeout

/* a fiber pends on a semaphore then times out */
static void test_fiber_pend_and_timeout(int data, int unused)
{
	struct timeout_order_data *the_data = (void *)data;
	int32_t orig_ticks = sys_tick_get();
	int rv;

	ARG_UNUSED(unused);

	rv = nano_fiber_sem_take(the_data->sem, the_data->timeout);
	if (rv) {
		TC_ERROR(" *** timeout of %d did not time out.\n",
					the_data->timeout);
		return;
	}
	if (!is_timeout_in_range(orig_ticks, the_data->timeout)) {
		return;
	}

	nano_fiber_fifo_put(&timeout_order_fifo, the_data);
}
開發者ID:CurieBSP,項目名稱:zephyr,代碼行數:21,代碼來源:sema.c

示例2: stm32_clock_control_get_subsys_rate

static int stm32_clock_control_get_subsys_rate(struct device *clock,
						clock_control_subsys_t sub_system,
						u32_t *rate)
{
	struct stm32_pclken *pclken = (struct stm32_pclken *)(sub_system);
	/*
	 * Get AHB Clock (= SystemCoreClock = SYSCLK/prescaler)
	 * SystemCoreClock is preferred to CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
	 * since it will be updated after clock configuration and hence
	 * more likely to contain actual clock speed
	 */
	u32_t ahb_clock = SystemCoreClock;
	u32_t apb1_clock = get_bus_clock(ahb_clock,
				CONFIG_CLOCK_STM32_APB1_PRESCALER);
#ifndef CONFIG_SOC_SERIES_STM32F0X
	u32_t apb2_clock = get_bus_clock(ahb_clock,
				CONFIG_CLOCK_STM32_APB2_PRESCALER);
#endif /* CONFIG_SOC_SERIES_STM32F0X */

	ARG_UNUSED(clock);

	switch (pclken->bus) {
	case STM32_CLOCK_BUS_AHB1:
	case STM32_CLOCK_BUS_AHB2:
		*rate = ahb_clock;
		break;
	case STM32_CLOCK_BUS_APB1:
#if defined(CONFIG_SOC_SERIES_STM32L4X) || defined(CONFIG_SOC_SERIES_STM32F0X)
	case STM32_CLOCK_BUS_APB1_2:
#endif /* CONFIG_SOC_SERIES_STM32L4X || CONFIG_SOC_SERIES_STM32F0X  */
		*rate = apb1_clock;
		break;
#ifndef CONFIG_SOC_SERIES_STM32F0X
	case STM32_CLOCK_BUS_APB2:
		*rate = apb2_clock;
		break;
#endif /* CONFIG_SOC_SERIES_STM32F0X */
	}

	return 0;
}
開發者ID:zmole945,項目名稱:zephyr,代碼行數:41,代碼來源:stm32_ll_clock.c

示例3: atmel_sam3x_init

/**
 * @brief Perform basic hardware initialization at boot.
 *
 * This needs to be run from the very beginning.
 * So the init priority has to be 0 (zero).
 *
 * @return 0
 */
static int atmel_sam3x_init(struct device *arg)
{
	u32_t key;

	ARG_UNUSED(arg);

	/* Note:
	 * Magic numbers below are obtained by reading the registers
	 * when the SoC was running the SAM-BA bootloader
	 * (with reserved bits set to 0).
	 */

	key = irq_lock();

	/* Setup the flash controller.
	 * The bootloader is running @ 48 MHz with
	 * FWS == 2.
	 * When running at 84 MHz, FWS == 4 seems
	 * to be more stable, and allows the board
	 * to boot.
	 */
	__EEFC0->fmr = 0x00000400;
	__EEFC1->fmr = 0x00000400;

	_ClearFaults();

	/* Setup master clock */
	clock_init();

	/* Disable watchdog timer, not used by system */
	__WDT->mr |= WDT_DISABLE;

	/* Install default handler that simply resets the CPU
	 * if configured in the kernel, NOP otherwise
	 */
	NMI_INIT();

	irq_unlock(key);

	return 0;
}
開發者ID:bboozzoo,項目名稱:zephyr,代碼行數:49,代碼來源:soc.c

示例4: qdec_nrfx_sample_fetch

static int qdec_nrfx_sample_fetch(struct device *dev, enum sensor_channel chan)
{
	struct qdec_nrfx_data *data = &qdec_nrfx_data;

	int16_t acc;
	int16_t accdbl;

	ARG_UNUSED(dev);

	LOG_DBG("");

	if ((chan != SENSOR_CHAN_ALL) && (chan != SENSOR_CHAN_ROTATION)) {
		return -ENOTSUP;
	}

	nrfx_qdec_accumulators_read(&acc, &accdbl);

	accumulate(data, acc);

	return 0;
}
開發者ID:milinddeore,項目名稱:zephyr,代碼行數:21,代碼來源:qdec_nrfx.c

示例5: pinmux_set

static int pinmux_set(struct device *dev, uint32_t pin, uint32_t func)
{
	volatile struct __pio *port = _get_port(pin);
	uint32_t tmp;

	ARG_UNUSED(dev);

	if (!port) {
		return -EINVAL;
	}

	tmp = port->absr;
	if (func) {
		tmp |= (1 << (pin % 32));
	} else {
		tmp &= ~(1 << (pin % 32));
	}
	port->absr = tmp;

	return 0;
}
開發者ID:sunkaizhu,項目名稱:zephyr,代碼行數:21,代碼來源:pinmux_dev_atmel_sam3x.c

示例6: recv_cb

static void recv_cb(struct net_context *net_ctx, struct net_pkt *pkt,
		    int status, void *data)
{
	struct http_client_ctx *ctx = data;

	ARG_UNUSED(net_ctx);

	if (status) {
		return;
	}

	if (!pkt || net_pkt_appdatalen(pkt) == 0) {
		/*
		 * This block most likely handles a TCP_FIN message.
		 * (this means the connection is now closed)
		 * If we get here, and req.wait.count is still 0 this means
		 * http client is still waiting to parse a response body.
		 * This will will never happen now.  Instead of generating
		 * an ETIMEDOUT error in the future, let's unlock the
		 * req.wait semaphore and let the app deal with whatever
		 * data was parsed in the header (IE: http status, etc).
		 */
		if (ctx->req.wait.count == 0) {
			k_sem_give(&ctx->req.wait);
		}

		goto out;
	}

	/* receive_cb must take ownership of the received packet */
	if (ctx->tcp.receive_cb) {
		ctx->tcp.receive_cb(ctx, pkt);
		return;
	}

out:
	if (pkt) {
		net_pkt_unref(pkt);
	}
}
開發者ID:rsalveti,項目名稱:zephyr,代碼行數:40,代碼來源:http_client.c

示例7: stack_fiber1

/**
 *
 * @brief Stack test fiber
 *
 * @param par1   Ignored parameter.
 * @param par2   Number of test loops.
 *
 * @return N/A
 *
 */
void stack_fiber1(int par1, int par2)
{
	int i;
	uint32_t data;

	ARG_UNUSED(par1);

	for (i = 0; i < par2 / 2; i++) {
		nano_fiber_stack_pop(&nano_stack_1, &data, TICKS_UNLIMITED);
		if (data != 2 * i) {
			break;
		}
		data = 2 * i;
		nano_fiber_stack_push(&nano_stack_2, data);
		nano_fiber_stack_pop(&nano_stack_1, &data, TICKS_UNLIMITED);
		if (data != 2 * i + 1) {
			break;
		}
		data = 2 * i + 1;
		nano_fiber_stack_push(&nano_stack_2, data);
	}
}
開發者ID:32bitmicro,項目名稱:zephyr,代碼行數:32,代碼來源:stack.c

示例8: hpet_isr

static void hpet_isr(void *arg)
{
	ARG_UNUSED(arg);
	k_spinlock_key_t key = k_spin_lock(&lock);
	u32_t now = MAIN_COUNTER_REG;
	u32_t dticks = (now - last_count) / cyc_per_tick;

	last_count += dticks * cyc_per_tick;

	if (!IS_ENABLED(CONFIG_TICKLESS_KERNEL) ||
	    IS_ENABLED(CONFIG_QEMU_TICKLESS_WORKAROUND)) {
		u32_t next = last_count + cyc_per_tick;

		if ((s32_t)(next - now) < MIN_DELAY) {
			next += cyc_per_tick;
		}
		TIMER0_COMPARATOR_REG = next;
	}

	k_spin_unlock(&lock, key);
	z_clock_announce(IS_ENABLED(CONFIG_TICKLESS_KERNEL) ? dticks : 1);
}
開發者ID:loicpoulain,項目名稱:zephyr,代碼行數:22,代碼來源:hpet.c

示例9: fiberEntry

static void fiberEntry(int task_thread_id, int arg1)
{
	int          rv;

	ARG_UNUSED(arg1);

	fiberEvidence++;    /* Prove to the task that the fiber has run */
	nano_fiber_sem_take(&wakeFiber, TICKS_UNLIMITED);

	rv = nanoCtxFiberTest((nano_thread_id_t) task_thread_id);
	if (rv != TC_PASS) {
		return;
	}

	/* Allow the task to print any messages before the next test runs */
	nano_fiber_sem_take(&wakeFiber, TICKS_UNLIMITED);

	rv = fiber_yieldTest();
	if (rv != TC_PASS) {
		return;
	}
}
開發者ID:CurieBSP,項目名稱:zephyr,代碼行數:22,代碼來源:context.c

示例10: isr_rand

void isr_rand(void *param)
{
	ARG_UNUSED(param);

	if (NRF_RNG->EVENTS_VALRDY) {
		u8_t last;

		last = rng->last + 1;
		if (last == rng->count) {
			last = 0;
		}

		if (last == rng->first) {
			/* this condition should not happen
			 * , but due to probable bug in HW
			 * , new value could be generated
			 * before task is stopped.
			 */
			NRF_RNG->TASKS_STOP = 1;
			NRF_RNG->EVENTS_VALRDY = 0;

			return;
		}

		rng->rand[rng->last] = NRF_RNG->VALUE;
		rng->last = last;

		last = rng->last + 1;
		if (last == rng->count) {
			last = 0;
		}

		NRF_RNG->EVENTS_VALRDY = 0;

		if (last == rng->first) {
			NRF_RNG->TASKS_STOP = 1;
		}
	}
}
開發者ID:bboozzoo,項目名稱:zephyr,代碼行數:39,代碼來源:rand.c

示例11: z_clock_driver_init

int z_clock_driver_init(struct device *device)
{
	ARG_UNUSED(device);
	IRQ_CONNECT(TIMER_IRQ, DT_LITEX_TIMER0_E0002800_IRQ_0_PRIORITY,
			litex_timer_irq_handler, NULL, 0);
	irq_enable(TIMER_IRQ);

	sys_write8(TIMER_DISABLE, TIMER_EN_ADDR);

	for (int i = 0; i < 4; i++) {
		sys_write8(sys_clock_hw_cycles_per_tick() >> (24 - i * 8),
				TIMER_RELOAD_ADDR + i * 0x4);
		sys_write8(sys_clock_hw_cycles_per_tick() >> (24 - i * 8),
				TIMER_LOAD_ADDR + i * 0x4);
	}

	sys_write8(TIMER_ENABLE, TIMER_EN_ADDR);
	sys_write8(sys_read8(TIMER_EV_PENDING_ADDR), TIMER_EV_PENDING_ADDR);
	sys_write8(TIMER_EV, TIMER_EV_ENABLE_ADDR);

	return 0;
}
開發者ID:workaroundgmbh,項目名稱:zephyr_public,代碼行數:22,代碼來源:litex_timer.c

示例12: isr

static void isr(void *arg)
{
	int byte, ret;

	ARG_UNUSED(arg);

	byte = random_byte_get();
	if (byte < 0) {
		return;
	}

	ret = rng_pool_put((struct rng_pool *)(entropy_nrf5_data.isr), byte);
	if (ret < 0) {
		ret = rng_pool_put((struct rng_pool *)(entropy_nrf5_data.thr),
				   byte);
		if (ret < 0) {
			nrf_rng_task_trigger(NRF_RNG_TASK_STOP);
		}

		k_sem_give(&entropy_nrf5_data.sem_sync);
	}
}
開發者ID:milinddeore,項目名稱:zephyr,代碼行數:22,代碼來源:entropy_nrf5.c

示例13: stack_fiber1

void stack_fiber1(int par1, int par2)
{
	int i;
	uint32_t data;

	ARG_UNUSED(par1);

	for (i = 0; i < par2 / 2; i++) {
		data = nano_fiber_stack_pop_wait(&nano_stack_1);
		if (data != 2 * i) {
			break;
		}
		data = 2 * i;
		nano_fiber_stack_push(&nano_stack_2, data);
		data = nano_fiber_stack_pop_wait(&nano_stack_1);
		if (data != 2 * i + 1) {
			break;
		}
		data = 2 * i + 1;
		nano_fiber_stack_push(&nano_stack_2, data);
	}
}
開發者ID:01org,項目名稱:CODK-A-Firmware,代碼行數:22,代碼來源:stack.c

示例14: _bt_spi_init

static int _bt_spi_init(struct device *unused)
{
	ARG_UNUSED(unused);

	spi_dev = device_get_binding(CONFIG_BLUETOOTH_SPI_DEV_NAME);
	if (!spi_dev) {
		BT_ERR("Failed to initialize SPI driver: %s",
		       CONFIG_BLUETOOTH_SPI_DEV_NAME);
		return -EIO;
	}

#if defined(CONFIG_BLUETOOTH_SPI_BLUENRG)
	cs_dev = device_get_binding(CONFIG_BLUETOOTH_SPI_CHIP_SELECT_DEV_NAME);
	if (!cs_dev) {
		BT_ERR("Failed to initialize GPIO driver: %s",
		       CONFIG_BLUETOOTH_SPI_CHIP_SELECT_DEV_NAME);
		return -EIO;
	}
#endif /* CONFIG_BLUETOOTH_SPI_BLUENRG */

	irq_dev = device_get_binding(CONFIG_BLUETOOTH_SPI_IRQ_DEV_NAME);
	if (!irq_dev) {
		BT_ERR("Failed to initialize GPIO driver: %s",
		       CONFIG_BLUETOOTH_SPI_IRQ_DEV_NAME);
		return -EIO;
	}

	rst_dev = device_get_binding(CONFIG_BLUETOOTH_SPI_RESET_DEV_NAME);
	if (!rst_dev) {
		BT_ERR("Failed to initialize GPIO driver: %s",
		       CONFIG_BLUETOOTH_SPI_RESET_DEV_NAME);
		return -EIO;
	}

	bt_hci_driver_register(&drv);

	return 0;
}
開發者ID:bboozzoo,項目名稱:zephyr,代碼行數:38,代碼來源:spi.c

示例15: stm32f10x_clock_control_get_subsys_rate

static
int stm32f10x_clock_control_get_subsys_rate(struct device *clock,
					    clock_control_subsys_t sub_system,
					    u32_t *rate)
{
	ARG_UNUSED(clock);

	u32_t subsys = POINTER_TO_UINT(sub_system);
	u32_t prescaler =
		CONFIG_CLOCK_STM32F10X_CONN_LINE_APB1_PRESCALER;
	/* assumes SYSCLK is SYS_CLOCK_HW_CYCLES_PER_SEC */
	u32_t ahb_clock =
		get_ahb_clock(CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC);

	if (subsys > STM32F10X_CLOCK_APB2_BASE) {
		prescaler =
			CONFIG_CLOCK_STM32F10X_CONN_LINE_APB2_PRESCALER;
	}

	*rate = get_apb_clock(ahb_clock, prescaler);

	return 0;
}
開發者ID:01org,項目名稱:zephyr,代碼行數:23,代碼來源:stm32f107xx_clock.c


注:本文中的ARG_UNUSED函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。