chip/npcx/peci.c: Format with clang-format
BRANCH=none
TEST=none
#include "temp_sensor.h"
#include "util.h"
-
/* Initial PECI baud rate */
#define PECI_BAUD_RATE 750000
#define TEMP_AVG_LENGTH 4 /* Should be power of 2 */
-
/* PECI Time-out */
#define PECI_DONE_TIMEOUT_US (10 * MSEC)
@@ -68,12 +66,8 @@ static int peci_pending_task_id;
* @param *wr_data Buffer pointer of write data
* @return TASK_EVENT_PECI_DONE that mean slave had a response
*/
-static uint32_t peci_trans(
- uint8_t wr_length,
- uint8_t rd_length,
- enum peci_command_t cmd_code,
- uint8_t *wr_data
-)
+static uint32_t peci_trans(uint8_t wr_length, uint8_t rd_length,
+ enum peci_command_t cmd_code, uint8_t *wr_data)
{
uint32_t events;
/* Ensure no PECI transaction is in progress */
@@ -119,9 +113,7 @@ static uint32_t peci_trans(
/* It should be using a interrupt , don't waste cpu computing power */
peci_pending_task_id = task_get_current();
- return task_wait_event_mask(TASK_EVENT_PECI_DONE,
- PECI_DONE_TIMEOUT_US);
-
+ return task_wait_event_mask(TASK_EVENT_PECI_DONE, PECI_DONE_TIMEOUT_US);
}
/**
@@ -269,7 +261,8 @@ static void peci_init(void)
DECLARE_HOOK(HOOK_INIT, peci_init, HOOK_PRIO_DEFAULT);
/* If received a PECI DONE interrupt, post the event to PECI task */
-static void peci_done_interrupt(void){
+static void peci_done_interrupt(void)
+{
if (peci_pending_task_id != NULL_PENDING_TASK_ID)
task_set_event(peci_pending_task_id, TASK_EVENT_PECI_DONE);
peci_sts = NPCX_PECI_CTL_STS & 0x18;
@@ -293,6 +286,5 @@ static int command_peci_temp(int argc, char **argv)
ccprintf("CPU temp = %d K = %d\n", t, K_TO_C(t));
return EC_SUCCESS;
}
-DECLARE_CONSOLE_COMMAND(pecitemp, command_peci_temp,
- NULL,
+DECLARE_CONSOLE_COMMAND(pecitemp, command_peci_temp, NULL,
"Print CPU temperature");
