本文整理汇总了C++中CPRINTS函数的典型用法代码示例。如果您正苦于以下问题:C++ CPRINTS函数的具体用法?C++ CPRINTS怎么用?C++ CPRINTS使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CPRINTS函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例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;
}
示例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();
}
}
示例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");
}
示例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);
}
}
示例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);
}
示例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");
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
示例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;
}