本文整理汇总了C++中CPRINTS函数的典型用法代码示例。如果您正苦于以下问题:C++ CPRINTS函数的具体用法?C++ CPRINTS怎么用?C++ CPRINTS使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CPRINTS函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: charge_shutdown
static void charge_shutdown(void)
{
/* Hibernate immediately if battery level is too low */
if (charge_want_shutdown()) {
CPRINTS("charge force EC hibernate after "
"shutdown due to low battery");
system_hibernate(0, 0);
}
}
开发者ID:longsleep,项目名称:ec,代码行数:9,代码来源:charge_state_v1.c
示例2: test_interrupt_disable
enum cts_rc test_interrupt_disable(void)
{
interrupt_disable();
if (!busy_loop()) {
CPRINTS("Expected timeout but didn't");
return CTS_RC_FAILURE;
}
return CTS_RC_SUCCESS;
}
开发者ID:coreboot,项目名称:chrome-ec,代码行数:9,代码来源:dut.c
示例3: low_battery_shutdown
/**
* Prevent battery from going into deep discharge state
*/
static void low_battery_shutdown(struct charge_state_context *ctx)
{
if (chipset_in_state(CHIPSET_STATE_ANY_OFF)) {
/* AP is off, so shut down the EC now */
CPRINTS("charge force EC hibernate due to low battery");
system_hibernate(0, 0);
} else if (!ctx->shutdown_warning_time.val) {
/* Warn AP battery level is so low we'll shut down */
CPRINTS("charge warn shutdown due to low battery");
ctx->shutdown_warning_time = get_time();
host_set_single_event(EC_HOST_EVENT_BATTERY_SHUTDOWN);
} else if (get_time().val > ctx->shutdown_warning_time.val +
LOW_BATTERY_SHUTDOWN_TIMEOUT_US) {
/* Timeout waiting for AP to shut down, so kill it */
CPRINTS("charge force shutdown due to low battery");
chipset_force_shutdown();
}
}
开发者ID:longsleep,项目名称:ec,代码行数:21,代码来源:charge_state_v1.c
示例4: board_set_charge_limit
/**
* Set the charge limit based upon desired maximum.
*
* @param charge_ma Desired charge limit (mA).
*/
void board_set_charge_limit(int charge_ma)
{
int rv;
charge_current_limit = MAX(charge_ma, CONFIG_CHARGER_INPUT_CURRENT);
rv = charge_set_input_current_limit(charge_current_limit);
if (rv < 0)
CPRINTS("Failed to set input current limit for PD");
}
开发者ID:fourier49,项目名称:BIZ_EC,代码行数:14,代码来源:board.c
示例5: chipset_reset
void chipset_reset(int is_cold)
{
if (is_cold) {
CPRINTS("EC triggered cold reboot");
power_off();
/* After POWER_GOOD is dropped off,
* the system will be on again
*/
power_request = POWER_REQ_ON;
} else {
CPRINTS("EC triggered warm reboot");
CPRINTS("assert GPIO_PMIC_WARM_RESET_L for %d ms",
PMIC_WARM_RESET_L_HOLD_TIME / MSEC);
set_pmic_warm_reset(1);
usleep(PMIC_WARM_RESET_L_HOLD_TIME);
set_pmic_warm_reset(0);
}
}
开发者ID:thehobn,项目名称:ec,代码行数:18,代码来源:rockchip.c
示例6: dump_i2c_reg
static void dump_i2c_reg(int port, const char *what)
{
CPRINTS("i2c CR1=%04x CR2=%04x SR1=%04x SR2=%04x %s",
STM32_I2C_CR1(port),
STM32_I2C_CR2(port),
STM32_I2C_SR1(port),
STM32_I2C_SR2(port),
what);
}
开发者ID:alterapraxisptyltd,项目名称:chromium-ec,代码行数:9,代码来源:i2c-stm32l.c
示例7: lpcrst_interrupt
void lpcrst_interrupt(enum gpio_signal signal)
{
if (lpc_get_pltrst_asserted())
/* Store port 80 reset event */
port_80_write(PORT_80_EVENT_RESET);
CPRINTS("LPC RESET# %sasserted",
lpc_get_pltrst_asserted() ? "" : "de");
}
开发者ID:coreboot,项目名称:chrome-ec,代码行数:9,代码来源:lpc.c
示例8: usb_disconnect
void usb_disconnect(void)
{
CPRINTS("%s", __func__);
print_later("usb_disconnect()", 0, 0, 0, 0, 0);
GR_USB_DCTL |= DCTL_SFTDISCON;
device_state = DS_DEFAULT;
configuration_value = 0;
}
开发者ID:littlebabay,项目名称:chrome-ec,代码行数:9,代码来源:usb.c
示例9: power_chipset_init
enum power_state power_chipset_init(void)
{
int init_power_state;
uint32_t reset_flags = system_get_reset_flags();
/*
* Force the AP shutdown unless we are doing SYSJUMP. Otherwise,
* the AP could stay in strange state.
*/
if (!(reset_flags & RESET_FLAG_SYSJUMP)) {
CPRINTS("not sysjump; forcing AP shutdown");
chipset_turn_off_power_rails();
/*
* The warm reset triggers AP into the RK recovery mode (
* flash SPI from USB).
*/
chipset_reset(0);
init_power_state = POWER_G3;
} else {
/* In the SYSJUMP case, we check if the AP is on */
if (power_get_signals() & IN_POWER_GOOD)
init_power_state = POWER_S0;
else
init_power_state = POWER_G3;
}
/* Leave power off only if requested by reset flags */
if (!(reset_flags & RESET_FLAG_AP_OFF) &&
!(reset_flags & RESET_FLAG_SYSJUMP)) {
CPRINTS("auto_power_on set due to reset_flag 0x%x",
system_get_reset_flags());
auto_power_on = 1;
}
/*
* Some batteries use clock stretching feature, which requires
* more time to be stable. See http://crosbug.com/p/28289
*/
battery_wait_for_stable();
return init_power_state;
}
开发者ID:coreboot,项目名称:chrome-ec,代码行数:44,代码来源:rockchip.c
示例10: power_has_signals
int power_has_signals(uint32_t want)
{
if ((in_signals & want) == want)
return 1;
CPRINTS("power lost input; wanted 0x%04x, got 0x%04x",
want, in_signals & want);
return 0;
}
开发者ID:Basavaraja-MS,项目名称:ec_local,代码行数:10,代码来源:common.c
示例11: power_button_pch_pulse
void power_button_pch_pulse(void)
{
CPRINTS("PB PCH pulse");
chipset_exit_hard_off();
set_pwrbtn_to_pch(0);
pwrbtn_state = PWRBTN_STATE_LID_OPEN;
tnext_state = get_time().val + PWRBTN_INITIAL_US;
task_wake(TASK_ID_POWERBTN);
}
开发者ID:thehobn,项目名称:ec,代码行数:10,代码来源:power_button_x86.c
示例12: chipset_force_shutdown
void chipset_force_shutdown(void)
{
CPRINTS("%s()", __func__);
/*
* Force off. This condition will reset once the state machine
* transitions to G3.
*/
gpio_set_level(GPIO_PCH_DPWROK, 0);
}
开发者ID:gelraen,项目名称:cros-ec,代码行数:10,代码来源:power_sequence.c
示例13: usb_mux_init
void usb_mux_init(int port)
{
const struct usb_mux *mux = &usb_muxes[port];
int res;
ASSERT(port >= 0 && port < CONFIG_USB_PD_PORT_COUNT);
res = mux->driver->init(mux->port_addr);
if (res)
CPRINTS("Error initializing mux port(%d): %d", port, res);
}
开发者ID:Basavaraja-MS,项目名称:ec_local,代码行数:10,代码来源:usb_mux.c
示例14: ipc_init
static void ipc_init(void)
{
CPRINTS("ipc_init");
/* Initialize host args and memory map to all zero */
memset(ipc_host_args, 0, sizeof(*ipc_host_args));
memset(lpc_get_memmap_range(), 0, EC_MEMMAP_SIZE);
setup_ipc();
}
开发者ID:coreboot,项目名称:chrome-ec,代码行数:10,代码来源:ipc.c
示例15: test_task_wait_event
enum cts_rc test_task_wait_event(void)
{
uint32_t event;
wake_me_up = 1;
/* Sleep and wait for interrupt. This shouldn't time out. */
event = task_wait_event(CTS_INTERRUPT_TRIGGER_DELAY_US * 2);
if (event != TASK_EVENT_WAKE) {
CPRINTS("Woken up by unexpected event: 0x%08x", event);
return CTS_RC_FAILURE;
}
if (!got_interrupt) {
CPRINTS("Interrupt context not detected");
return CTS_RC_TIMEOUT;
}
return CTS_RC_SUCCESS;
}
开发者ID:coreboot,项目名称:chrome-ec,代码行数:19,代码来源:dut.c
示例16: i2c_event_handler
static void i2c_event_handler(int port)
{
/* save and clear status */
i2c_sr1[port] = STM32_I2C_SR1(port);
STM32_I2C_SR1(port) = 0;
/* Confirm that you are not in master mode */
if (STM32_I2C_SR2(port) & (1 << 0)) {
CPRINTS("slave ISR triggered in master mode, ignoring");
return;
}
/* transfer matched our slave address */
if (i2c_sr1[port] & (1 << 1)) {
/* If it's a receiver slave */
if (!(STM32_I2C_SR2(port) & (1 << 2))) {
dma_start_rx(dma_rx_option + port, sizeof(host_buffer),
host_buffer);
STM32_I2C_CR2(port) |= (1 << 11);
rx_pending = 1;
}
/* cleared by reading SR1 followed by reading SR2 */
STM32_I2C_SR1(port);
STM32_I2C_SR2(port);
} else if (i2c_sr1[port] & (1 << 4)) {
/* If it's a receiver slave */
if (!(STM32_I2C_SR2(port) & (1 << 2))) {
/* Disable, and clear the DMA transfer complete flag */
dma_disable(DMAC_SLAVE_RX);
dma_clear_isr(DMAC_SLAVE_RX);
/* Turn off i2c's DMA flag */
STM32_I2C_CR2(port) &= ~(1 << 11);
}
/* clear STOPF bit by reading SR1 and then writing CR1 */
STM32_I2C_SR1(port);
STM32_I2C_CR1(port) = STM32_I2C_CR1(port);
}
/* TxE event */
if (i2c_sr1[port] & (1 << 7)) {
if (port == I2C2) { /* AP is waiting for EC response */
if (rx_pending) {
i2c_process_command();
/* reset host buffer after end of transfer */
rx_pending = 0;
} else {
/* spurious read : return dummy value */
STM32_I2C_DR(port) = 0xec;
}
}
}
}
开发者ID:alterapraxisptyltd,项目名称:chromium-ec,代码行数:55,代码来源:i2c-stm32f.c
示例17: hang_detect_start
/**
* Start the hang detect timers.
*/
static void hang_detect_start(const char *why)
{
/* If already active, don't restart timer */
if (active)
return;
if (hdparams.host_event_timeout_msec) {
CPRINTS("hang detect started on %s (for event)", why);
timeout_will_reboot = 0;
active = 1;
hook_call_deferred(hang_detect_deferred,
hdparams.host_event_timeout_msec * MSEC);
} else if (hdparams.warm_reboot_timeout_msec) {
CPRINTS("hang detect started on %s (for reboot)", why);
timeout_will_reboot = 1;
active = 1;
hook_call_deferred(hang_detect_deferred,
hdparams.warm_reboot_timeout_msec * MSEC);
}
}
开发者ID:Basavaraja-MS,项目名称:ec_local,代码行数:23,代码来源:ap_hang_detect.c
示例18: board_hibernate
void board_hibernate(void)
{
CPRINTS("Triggering PMIC shutdown.");
uart_flush_output();
/* Trigger PMIC shutdown. */
if (i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992, 0x49, 0x01)) {
/*
* If we can't tell the PMIC to shutdown, instead reset
* and don't start the AP. Hopefully we'll be able to
* communicate with the PMIC next time.
*/
CPRINTS("PMIC i2c failed.");
system_reset(SYSTEM_RESET_LEAVE_AP_OFF);
}
/* Await shutdown. */
while (1)
;
}
开发者ID:coreboot,项目名称:chrome-ec,代码行数:20,代码来源:board.c
示例19: test_nested_interrupt_low_high
enum cts_rc test_nested_interrupt_low_high(void)
{
uint32_t event;
event = task_wait_event(CTS_INTERRUPT_TRIGGER_DELAY_US * 4);
if (event != TASK_EVENT_TIMER) {
CPRINTS("Woken up by unexpected event: 0x%08x", event);
return CTS_RC_FAILURE;
}
if (!got_interrupt) {
CPRINTS("Interrupt context not detected");
return CTS_RC_TIMEOUT;
}
if (memcmp(state, "ABCD", sizeof(state))) {
CPRINTS("State transition differs from expectation");
return CTS_RC_FAILURE;
}
return CTS_RC_SUCCESS;
}
开发者ID:coreboot,项目名称:chrome-ec,代码行数:20,代码来源:dut.c
示例20: vboot_hash_abort
/**
* Abort hash currently in progress, and invalidate any completed hash.
*/
static void vboot_hash_abort(void)
{
if (in_progress) {
want_abort = 1;
} else {
CPRINTS("hash abort");
want_abort = 0;
data_size = 0;
hash = NULL;
}
}
开发者ID:thehobn,项目名称:ec,代码行数:14,代码来源:vboot_hash.c
注:本文中的CPRINTS函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论