docstring
stringlengths
22
576
signature
stringlengths
9
317
prompt
stringlengths
57
886
code
stringlengths
20
1.36k
repository
stringclasses
49 values
language
stringclasses
2 values
license
stringclasses
9 values
stars
int64
15
21.3k
/* Set the boot bank to the power-on default bank */
void pixis_bank_reset(void)
/* Set the boot bank to the power-on default bank */ void pixis_bank_reset(void)
{ u8 reg; reg = PIXIS_READ(s[PIXIS_LBMAP_SWITCH - 1].en); reg &= ~PIXIS_LBMAP_MASK; PIXIS_WRITE(s[PIXIS_LBMAP_SWITCH - 1].en, reg); }
4ms/stm32mp1-baremetal
C++
Other
137
/* Program interrupt vector for specified irq. The routine writes the interrupt vector in the Interrupt Redirection Table for specified irq number */
__boot_func void z_ioapic_int_vec_set(unsigned int irq, unsigned int vector)
/* Program interrupt vector for specified irq. The routine writes the interrupt vector in the Interrupt Redirection Table for specified irq number */ __boot_func void z_ioapic_int_vec_set(unsigned int irq, unsigned int vector)
{ IoApicRedUpdateLo(irq, vector, IOAPIC_VEC_MASK); }
zephyrproject-rtos/zephyr
C++
Apache License 2.0
9,573
/* We need to stop the aild from running before we destroy and deallocate the log as the aild references the log. */
void xfs_log_unmount(xfs_mount_t *mp)
/* We need to stop the aild from running before we destroy and deallocate the log as the aild references the log. */ void xfs_log_unmount(xfs_mount_t *mp)
{ xfs_trans_ail_destroy(mp); xlog_dealloc_log(mp->m_log); }
robutest/uclinux
C++
GPL-2.0
60
/* Truncate the given synchronous offset to a value the current adapter type and syncrate are capable of. */
static void ahc_validate_offset(struct ahc_softc *ahc, struct ahc_initiator_tinfo *tinfo, const struct ahc_syncrate *syncrate, u_int *offset, int wide, role_t role)
/* Truncate the given synchronous offset to a value the current adapter type and syncrate are capable of. */ static void ahc_validate_offset(struct ahc_softc *ahc, struct ahc_initiator_tinfo *tinfo, const struct ahc_syncrate *syncrate, u_int *offset, int wide, role_t role)
{ u_int maxoffset; if (syncrate == NULL) { maxoffset = 0; } else if ((ahc->features & AHC_ULTRA2) != 0) { maxoffset = MAX_OFFSET_ULTRA2; } else { if (wide) maxoffset = MAX_OFFSET_16BIT; else maxoffset = MAX_OFFSET_8BIT; } *offset = min(*offset, maxoffset); if (tinfo != NULL) { if (role == ROLE_TARGET) *offset = min(*offset, (u_int)tinfo->user.offset); else *offset = min(*offset, (u_int)tinfo->goal.offset); } }
robutest/uclinux
C++
GPL-2.0
60
/* scsi_noretry_cmd - determinte if command should be failed fast @scmd: SCSI cmd to examine. */
int scsi_noretry_cmd(struct scsi_cmnd *scmd)
/* scsi_noretry_cmd - determinte if command should be failed fast @scmd: SCSI cmd to examine. */ int scsi_noretry_cmd(struct scsi_cmnd *scmd)
{ switch (host_byte(scmd->result)) { case DID_OK: break; case DID_BUS_BUSY: return blk_failfast_transport(scmd->request); case DID_PARITY: return blk_failfast_dev(scmd->request); case DID_ERROR: if (msg_byte(scmd->result) == COMMAND_COMPLETE && status_byte(scmd->result) == RESERVATION_CONFLICT) return 0; case DID_SOFT_ERROR: return blk_failfast_driver(scmd->request); } switch (status_byte(scmd->result)) { case CHECK_CONDITION: return blk_failfast_dev(scmd->request); } return 0; }
robutest/uclinux
C++
GPL-2.0
60
/* If the adapter has only 2 LEDs, the green LED will blink with a rate depending on the number of channels opened. */
static void led_blink(struct st5481_adapter *adapter)
/* If the adapter has only 2 LEDs, the green LED will blink with a rate depending on the number of channels opened. */ static void led_blink(struct st5481_adapter *adapter)
{ u_char leds = adapter->leds; if (++adapter->led_counter % 50) { return; } if (adapter->led_counter % 100) { leds |= GREEN_LED; } else { leds &= ~GREEN_LED; } st5481_usb_device_ctrl_msg(adapter, GPIO_OUT, leds, NULL, NULL); }
robutest/uclinux
C++
GPL-2.0
60
/* Software reset. Restore the default values in user registers. */
int32_t lsm6dso_reset_set(stmdev_ctx_t *ctx, uint8_t val)
/* Software reset. Restore the default values in user registers. */ int32_t lsm6dso_reset_set(stmdev_ctx_t *ctx, uint8_t val)
{ lsm6dso_ctrl3_c_t reg; int32_t ret; ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)&reg, 1); if (ret == 0) { reg.sw_reset = val; ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL3_C, (uint8_t *)&reg, 1); } return ret; }
eclipse-threadx/getting-started
C++
Other
310
/* Configure pin. Function configures selected for work as SDA or SCL. */
static void nrf_drv_twis_config_pin(uint32_t pin)
/* Configure pin. Function configures selected for work as SDA or SCL. */ static void nrf_drv_twis_config_pin(uint32_t pin)
{ nrf_gpio_cfg(pin, NRF_GPIO_PIN_DIR_INPUT, NRF_GPIO_PIN_INPUT_DISCONNECT, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_S0D1, NRF_GPIO_PIN_NOSENSE); }
labapart/polymcu
C++
null
201
/* Atomically swap in the new signal mask, and wait for a signal. */
asmlinkage int sys32_sigsuspend(nabi_no_regargs struct pt_regs regs)
/* Atomically swap in the new signal mask, and wait for a signal. */ asmlinkage int sys32_sigsuspend(nabi_no_regargs struct pt_regs regs)
{ compat_sigset_t __user *uset; sigset_t newset; uset = (compat_sigset_t __user *) regs.regs[4]; if (get_sigset(&newset, uset)) return -EFAULT; sigdelsetmask(&newset, ~_BLOCKABLE); spin_lock_irq(&current->sighand->siglock); current->saved_sigmask = current->blocked; current->blocked = newset; recalc_sigpending(); spin_unlock_irq(&current->sighand->siglock); current->state = TASK_INTERRUPTIBLE; schedule(); set_thread_flag(TIF_RESTORE_SIGMASK); return -ERESTARTNOHAND; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Calculate the number of pages, each of the given size, that fit in a memory of the specified size, respecting the HW requirement that the number of pages must be a multiple of 24. */
static unsigned int pm_num_pages(unsigned int mem_size, unsigned int pg_size)
/* Calculate the number of pages, each of the given size, that fit in a memory of the specified size, respecting the HW requirement that the number of pages must be a multiple of 24. */ static unsigned int pm_num_pages(unsigned int mem_size, unsigned int pg_size)
{ unsigned int n = mem_size / pg_size; return n - n % 24; }
robutest/uclinux
C++
GPL-2.0
60
/* Return value: 0 on success / non-zero on failure */
static irqreturn_t __devinit ipr_test_intr(int irq, void *devp)
/* Return value: 0 on success / non-zero on failure */ static irqreturn_t __devinit ipr_test_intr(int irq, void *devp)
{ struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)devp; unsigned long lock_flags = 0; irqreturn_t rc = IRQ_HANDLED; spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags); ioa_cfg->msi_received = 1; wake_up(&ioa_cfg->msi_wait_q); spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); return rc; }
robutest/uclinux
C++
GPL-2.0
60
/* Check if the interface of given number is valid. */
static bool is_interface_valid(uint8_t interface)
/* Check if the interface of given number is valid. */ static bool is_interface_valid(uint8_t interface)
{ const uint8_t *p = (uint8_t *)usb_dev.descriptors; const struct usb_cfg_descriptor *cfg_descr; while (p[DESC_bLength] != 0U) { if (p[DESC_bDescriptorType] == USB_DESC_CONFIGURATION) { cfg_descr = (const struct usb_cfg_descriptor *)p; if (interface < cfg_descr->bNumInterfaces) { return true; } } p += p[DESC_bLength]; } return false; }
zephyrproject-rtos/zephyr
C++
Apache License 2.0
9,573
/* Completes the Map() operation and releases any corresponding resources. */
EFI_STATUS IoMmuUnmap(IN VOID *Mapping)
/* Completes the Map() operation and releases any corresponding resources. */ EFI_STATUS IoMmuUnmap(IN VOID *Mapping)
{ EFI_STATUS Status; EDKII_IOMMU_PPI *IoMmu; IoMmu = GetIoMmu (); if (IoMmu != NULL) { Status = IoMmu->SetAttribute (IoMmu, Mapping, 0); Status = IoMmu->Unmap (IoMmu, Mapping); } else { Status = EFI_SUCCESS; } return Status; }
tianocore/edk2
C++
Other
4,240
/* Retrieves a Unicode string that is the user readable name of the UEFI Driver. */
EFI_STATUS EFIAPI SataControllerComponentNameGetDriverName(IN EFI_COMPONENT_NAME_PROTOCOL *This, IN CHAR8 *Language, OUT CHAR16 **DriverName)
/* Retrieves a Unicode string that is the user readable name of the UEFI Driver. */ EFI_STATUS EFIAPI SataControllerComponentNameGetDriverName(IN EFI_COMPONENT_NAME_PROTOCOL *This, IN CHAR8 *Language, OUT CHAR16 **DriverName)
{ return LookupUnicodeString2 ( Language, This->SupportedLanguages, mSataControllerDriverNameTable, DriverName, (BOOLEAN)(This == &gSataControllerComponentName) ); }
tianocore/edk2
C++
Other
4,240
/* The example of the function of read and write. */
void M24CxxReadWrite(void)
/* The example of the function of read and write. */ void M24CxxReadWrite(void)
{ unsigned long i; xSysCtlClockSet(72000000, xSYSCTL_OSC_MAIN | xSYSCTL_XTAL_8MHZ); UartInit(); HT24CxxInit(); UartPrintfChar('\r'); UartPrintfChar('\n'); HT24CxxBufferWrite(ucWriteData, WriteAddress, Length); HT24CxxBufferRead(ucReadData, WriteAddress, Length); for(i = 0; i < Length; i++) { UartPrintfChar(ucReadData[i]); } }
coocox/cox
C++
Berkeley Software Distribution (BSD)
104
/* This file is part of the TinyUSB stack. */
void fomu_error(uint32_t line)
/* This file is part of the TinyUSB stack. */ void fomu_error(uint32_t line)
{ (void)line; TU_BREAKPOINT(); }
prusa3d/Prusa-Firmware-Buddy
C++
Other
1,019
/* RETURNS: Return value from __ata_scsi_queuecmd() if @cmd can be queued, 0 otherwise. */
int ata_sas_queuecmd(struct scsi_cmnd *cmd, void(*done)(struct scsi_cmnd *), struct ata_port *ap)
/* RETURNS: Return value from __ata_scsi_queuecmd() if @cmd can be queued, 0 otherwise. */ int ata_sas_queuecmd(struct scsi_cmnd *cmd, void(*done)(struct scsi_cmnd *), struct ata_port *ap)
{ int rc = 0; ata_scsi_dump_cdb(ap, cmd); if (likely(ata_dev_enabled(ap->link.device))) rc = __ata_scsi_queuecmd(cmd, done, ap->link.device); else { cmd->result = (DID_BAD_TARGET << 16); done(cmd); } return rc; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* TIM_Base MSP De-Initialization This function freeze the hardware resources used in this example. */
void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef *htim_base)
/* TIM_Base MSP De-Initialization This function freeze the hardware resources used in this example. */ void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef *htim_base)
{ if(htim_base->Instance==TIM1) { __HAL_RCC_TIM1_CLK_DISABLE(); } else if(htim_base->Instance==TIM3) { __HAL_RCC_TIM3_CLK_DISABLE(); } }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* But the limit should not be set too high. Because it also controls the amount of memory which the balance_dirty_pages() caller has to write back. If this is too large then the caller will block on the IO queue all the time. So limit it to four megabytes - the balance_dirty_pages() caller will write six megabyte chunks, max. */
void writeback_set_ratelimit(void)
/* But the limit should not be set too high. Because it also controls the amount of memory which the balance_dirty_pages() caller has to write back. If this is too large then the caller will block on the IO queue all the time. So limit it to four megabytes - the balance_dirty_pages() caller will write six megabyte chunks, max. */ void writeback_set_ratelimit(void)
{ ratelimit_pages = vm_total_pages / (num_online_cpus() * 32); if (ratelimit_pages < 16) ratelimit_pages = 16; if (ratelimit_pages * PAGE_CACHE_SIZE > 4096 * 1024) ratelimit_pages = (4096 * 1024) / PAGE_CACHE_SIZE; }
robutest/uclinux
C++
GPL-2.0
60
/* Once every 3 seconds we get a callback here which we use to update the tap extensions. */
static gboolean tap_update_cb(gpointer data _U_)
/* Once every 3 seconds we get a callback here which we use to update the tap extensions. */ static gboolean tap_update_cb(gpointer data _U_)
{ draw_tap_listeners(FALSE); return TRUE; }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* Check if the combination for Attribute and Mask is valid for non-present entry. 1.Mask.Present is 0 but some other attributes is provided. This case should be invalid. 2.Map non-present range to present. In this case, all attributes should be provided. */
RETURN_STATUS IsAttributesAndMaskValidForNonPresentEntry(IN IA32_MAP_ATTRIBUTE *Attribute, IN IA32_MAP_ATTRIBUTE *Mask)
/* Check if the combination for Attribute and Mask is valid for non-present entry. 1.Mask.Present is 0 but some other attributes is provided. This case should be invalid. 2.Map non-present range to present. In this case, all attributes should be provided. */ RETURN_STATUS IsAttributesAndMaskValidForNonPresentEntry(IN IA32_MAP_ATTRIBUTE *Attribute, IN IA32_MAP_ATTRIBUTE *Mask)
{ if ((Mask->Bits.Present == 1) && (Attribute->Bits.Present == 1)) { if ((Mask->Bits.ReadWrite == 0) || (Mask->Bits.UserSupervisor == 0) || (Mask->Bits.WriteThrough == 0) || (Mask->Bits.CacheDisabled == 0) || (Mask->Bits.Accessed == 0) || (Mask->Bits.Dirty == 0) || (Mask->Bits.Pat == 0) || (Mask->Bits.Global == 0) || ((Mask->Bits.PageTableBaseAddressLow == 0) && (Mask->Bits.PageTableBaseAddressHigh == 0)) || (Mask->Bits.ProtectionKey == 0) || (Mask->Bits.Nx == 0)) { return RETURN_INVALID_PARAMETER; } } else if ((Mask->Bits.Present == 0) && (Mask->Uint64 > 1)) { return RETURN_INVALID_PARAMETER; } return RETURN_SUCCESS; }
tianocore/edk2
C++
Other
4,240
/* RELOAD mode must be selected if total number of data bytes to be sent is greater than MAX_LEN */
static void stm32_i2c_handle_reload(struct stm32_i2c_priv *i2c_priv, struct i2c_msg *msg, bool stop)
/* RELOAD mode must be selected if total number of data bytes to be sent is greater than MAX_LEN */ static void stm32_i2c_handle_reload(struct stm32_i2c_priv *i2c_priv, struct i2c_msg *msg, bool stop)
{ struct stm32_i2c_regs *regs = i2c_priv->regs; u32 cr2 = readl(&regs->cr2); cr2 &= ~STM32_I2C_CR2_NBYTES_MASK; if (msg->len > STM32_I2C_MAX_LEN) { cr2 |= STM32_I2C_CR2_NBYTES(STM32_I2C_MAX_LEN); } else { cr2 &= ~STM32_I2C_CR2_RELOAD; cr2 |= STM32_I2C_CR2_NBYTES(msg->len); } writel(cr2, &regs->cr2); }
4ms/stm32mp1-baremetal
C++
Other
137
/* If BufferSize is 0, then no output buffer is produced and 0 is returned. */
UINTN EFIAPI AsciiVSPrintUnicodeFormat(OUT CHAR8 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR16 *FormatString, IN VA_LIST Marker)
/* If BufferSize is 0, then no output buffer is produced and 0 is returned. */ UINTN EFIAPI AsciiVSPrintUnicodeFormat(OUT CHAR8 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR16 *FormatString, IN VA_LIST Marker)
{ ASSERT_UNICODE_BUFFER (FormatString); return BasePrintLibSPrintMarker (StartOfBuffer, BufferSize, FORMAT_UNICODE, (CHAR8 *)FormatString, Marker, NULL); }
tianocore/edk2
C++
Other
4,240
/* Returns 3-element vector of linear accel float data. */
inv_error_t inv_get_linear_accel_float(float *data)
/* Returns 3-element vector of linear accel float data. */ inv_error_t inv_get_linear_accel_float(float *data)
{ long tdata[3]; unsigned char i; if (data != NULL && !inv_get_linear_accel(tdata)) { for (i = 0; i < 3; ++i) { data[i] = ((float)tdata[i] / (1L << 16)); } return INV_SUCCESS; } else { return INV_ERROR_INVALID_PARAMETER; } }
Luos-io/luos_engine
C++
MIT License
496
/* Context: Link Layer task (can be called from interrupt context though). */
uint8_t ble_ll_state_get(void)
/* Context: Link Layer task (can be called from interrupt context though). */ uint8_t ble_ll_state_get(void)
{ return g_ble_ll_data.ll_state; }
arendst/Tasmota
C++
GNU General Public License v3.0
21,318
/* If DhContext is NULL, then return FALSE. If PeerPublicKey is NULL, then return FALSE. If KeySize is NULL, then return FALSE. If Key is NULL, then return FALSE. If KeySize is not large enough, then return FALSE. If this interface is not supported, then return FALSE. */
BOOLEAN EFIAPI CryptoServiceDhComputeKey(IN OUT VOID *DhContext, IN CONST UINT8 *PeerPublicKey, IN UINTN PeerPublicKeySize, OUT UINT8 *Key, IN OUT UINTN *KeySize)
/* If DhContext is NULL, then return FALSE. If PeerPublicKey is NULL, then return FALSE. If KeySize is NULL, then return FALSE. If Key is NULL, then return FALSE. If KeySize is not large enough, then return FALSE. If this interface is not supported, then return FALSE. */ BOOLEAN EFIAPI CryptoServiceDhComputeKey(IN OUT VOID *DhContext, IN CONST UINT8 *PeerPublicKey, IN UINTN PeerPublicKeySize, OUT UINT8 *Key, IN OUT UINTN *KeySize)
{ return CALL_BASECRYPTLIB (Dh.Services.ComputeKey, DhComputeKey, (DhContext, PeerPublicKey, PeerPublicKeySize, Key, KeySize), FALSE); }
tianocore/edk2
C++
Other
4,240
/* check whether, in an assignment to a local variable, the local variable is needed in a previous assignment (to a table). If so, save original local value in a safe place and use this safe copy in the previous assignment. */
static void check_conflict(LexState *ls, struct LHS_assign *lh, expdesc *v)
/* check whether, in an assignment to a local variable, the local variable is needed in a previous assignment (to a table). If so, save original local value in a safe place and use this safe copy in the previous assignment. */ static void check_conflict(LexState *ls, struct LHS_assign *lh, expdesc *v)
{ if (lh->v.k == VINDEXED) { if (lh->v.u.s.info == v->u.s.info) { conflict = 1; lh->v.u.s.info = extra; } if (lh->v.u.s.aux == v->u.s.info) { conflict = 1; lh->v.u.s.aux = extra; } } } if (conflict) { luaK_codeABC(fs, OP_MOVE, fs->freereg, v->u.s.info, 0); luaK_reserveregs(fs, 1); } }
Nicholas3388/LuaNode
C++
Other
1,055
/* retval kStatus_Success RDC_SEMA42 gate is reset successfully. retval kStatus_Failed Some other reset process is ongoing. */
status_t RDC_SEMA42_ResetGate(RDC_SEMAPHORE_Type *base, uint8_t gateNum)
/* retval kStatus_Success RDC_SEMA42 gate is reset successfully. retval kStatus_Failed Some other reset process is ongoing. */ status_t RDC_SEMA42_ResetGate(RDC_SEMAPHORE_Type *base, uint8_t gateNum)
{ status_t status; if (0U != (base->RSTGT_R & RDC_SEMAPHORE_RSTGT_R_RSTGSM_MASK)) { status = kStatus_Fail; } else { base->RSTGT_W = RDC_SEMAPHORE_RSTGT_W_RSTGDP(RDC_SEMA42_GATE_RESET_PATTERN_1); base->RSTGT_W = RDC_SEMAPHORE_RSTGT_W_RSTGDP(RDC_SEMA42_GATE_RESET_PATTERN_2) | RDC_SEMAPHORE_RSTGT_W_RSTGTN(gateNum); status = kStatus_Success; } return status; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Extract the blockcount field from an in memory bmap extent record. */
xfs_filblks_t xfs_bmbt_get_blockcount(xfs_bmbt_rec_host_t *r)
/* Extract the blockcount field from an in memory bmap extent record. */ xfs_filblks_t xfs_bmbt_get_blockcount(xfs_bmbt_rec_host_t *r)
{ return (xfs_filblks_t)(r->l1 & xfs_mask64lo(21)); }
robutest/uclinux
C++
GPL-2.0
60
/* Read data with special length in master mode through the I2Cx peripheral under in-house IP. */
u8 I2C_MasterRead(I2C_TypeDef *I2Cx, u8 *pBuf, u8 len)
/* Read data with special length in master mode through the I2Cx peripheral under in-house IP. */ u8 I2C_MasterRead(I2C_TypeDef *I2Cx, u8 *pBuf, u8 len)
{ u8 cnt = 0; assert_param(IS_I2C_ALL_PERIPH(I2Cx)); for(cnt = 0; cnt < len; cnt++) { if(cnt >= len - 1) { I2Cx->IC_DATA_CMD = 0x0003 << 8; } else { I2Cx->IC_DATA_CMD = 0x0001 << 8; } while((I2C_CheckFlagState(I2Cx, BIT_IC_STATUS_RFNE)) == 0) { if(I2C_GetRawINT(I2Cx) & BIT_IC_RAW_INTR_STAT_TX_ABRT) { I2C_ClearAllINT(I2Cx); return cnt; } } *pBuf++ = (u8)I2Cx->IC_DATA_CMD; } return cnt; }
alibaba/AliOS-Things
C++
Apache License 2.0
4,536
/* Return: 0 on success or a negative error code on failure. */
int mipi_dsi_dcs_set_display_off(struct mipi_dsi_device *dsi)
/* Return: 0 on success or a negative error code on failure. */ int mipi_dsi_dcs_set_display_off(struct mipi_dsi_device *dsi)
{ ssize_t err; err = mipi_dsi_dcs_write(dsi, MIPI_DCS_SET_DISPLAY_OFF, NULL, 0); if (err < 0) return err; return 0; }
4ms/stm32mp1-baremetal
C++
Other
137
/* We are doing protocol-specific connecting and this is being called over and over from the multi interface until the connection phase is done on protocol layer. */
CURLcode Curl_protocol_connecting(struct connectdata *conn, bool *done)
/* We are doing protocol-specific connecting and this is being called over and over from the multi interface until the connection phase is done on protocol layer. */ CURLcode Curl_protocol_connecting(struct connectdata *conn, bool *done)
{ CURLcode result = CURLE_OK; if(conn && conn->handler->connecting) { *done = FALSE; result = conn->handler->connecting(conn, done); } else *done = TRUE; return result; }
alibaba/AliOS-Things
C++
Apache License 2.0
4,536
/* This function is used to check for the read to clear bits within the V2P mailbox. */
static s32 e1000_check_for_bit_vf(struct e1000_hw *hw, u32 mask)
/* This function is used to check for the read to clear bits within the V2P mailbox. */ static s32 e1000_check_for_bit_vf(struct e1000_hw *hw, u32 mask)
{ u32 v2p_mailbox = e1000_read_v2p_mailbox(hw); s32 ret_val = -E1000_ERR_MBX; if (v2p_mailbox & mask) ret_val = E1000_SUCCESS; hw->dev_spec.vf.v2p_mailbox &= ~mask; return ret_val; }
robutest/uclinux
C++
GPL-2.0
60
/* Read a register of the device through BUS. */
static int32_t I2C1_ReadReg(uint16_t DevAddr, uint16_t Reg, uint16_t MemAddSize, uint8_t *pData, uint16_t Length)
/* Read a register of the device through BUS. */ static int32_t I2C1_ReadReg(uint16_t DevAddr, uint16_t Reg, uint16_t MemAddSize, uint8_t *pData, uint16_t Length)
{ if (HAL_I2C_Mem_Read(&hbus_i2c1, DevAddr, Reg, MemAddSize, pData, Length, 10000) == HAL_OK) { return BSP_ERROR_NONE; } return BSP_ERROR_BUS_FAILURE; }
eclipse-threadx/getting-started
C++
Other
310
/* Get COUNTER_CLK_PERIOD. Usually the period is in femtoseconds. If this is not the case, define HPET_COUNTER_CLK_PERIOD in soc.h so it can be used to calculate frequency. */
static uint32_t hpet_counter_clk_period_get(void)
/* Get COUNTER_CLK_PERIOD. Usually the period is in femtoseconds. If this is not the case, define HPET_COUNTER_CLK_PERIOD in soc.h so it can be used to calculate frequency. */ static uint32_t hpet_counter_clk_period_get(void)
{ return sys_read32(CLK_PERIOD_REG); }
zephyrproject-rtos/zephyr
C++
Apache License 2.0
9,573
/* Advance/Retreat lines and set CurrentLine in FileBuffer to it */
EFI_EDITOR_LINE* MoveCurrentLine(IN INTN Count)
/* Advance/Retreat lines and set CurrentLine in FileBuffer to it */ EFI_EDITOR_LINE* MoveCurrentLine(IN INTN Count)
{ EFI_EDITOR_LINE *Line; UINTN AbsCount; if (Count <= 0) { AbsCount = (UINTN)ABS (Count); Line = InternalEditorMiscLineRetreat (AbsCount, MainEditor.FileBuffer->CurrentLine, MainEditor.FileBuffer->ListHead); } else { Line = InternalEditorMiscLineAdvance ((UINTN)Count, MainEditor.FileBuffer->CurrentLine, MainEditor.FileBuffer->ListHead); } if (Line == NULL) { return NULL; } MainEditor.FileBuffer->CurrentLine = Line; return Line; }
tianocore/edk2
C++
Other
4,240
/* This function returns the window command of the specified button, as set when the widget was created. */
win_command_t wtk_button_get_command(struct wtk_button *button)
/* This function returns the window command of the specified button, as set when the widget was created. */ win_command_t wtk_button_get_command(struct wtk_button *button)
{ Assert(button); return button->command; }
memfault/zero-to-main
C++
null
200
/* USB Device Interrupt enable Called by USBD_Init to enable the USB Interrupt Return Value: None */
void USBD_IntrEna(void)
/* USB Device Interrupt enable Called by USBD_Init to enable the USB Interrupt Return Value: None */ void USBD_IntrEna(void)
{ NVIC_EnableIRQ(UDPHS_IRQn); }
ARMmbed/DAPLink
C++
Apache License 2.0
2,140
/* Disable the irq on the all cores for chips that have the EN*_W1{S,C} registers. */
static void octeon_irq_ciu0_disable_all_v2(unsigned int irq)
/* Disable the irq on the all cores for chips that have the EN*_W1{S,C} registers. */ static void octeon_irq_ciu0_disable_all_v2(unsigned int irq)
{ u64 mask = 1ull << (irq - OCTEON_IRQ_WORKQ0); int index; int cpu; for_each_online_cpu(cpu) { index = octeon_coreid_for_cpu(cpu) * 2; cvmx_write_csr(CVMX_CIU_INTX_EN0_W1C(index), mask); } }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Displays a bitmap picture loaded in the internal Flash. */
void hx8347i_DrawBitmap(uint16_t Xpos, uint16_t Ypos, uint8_t *pbmp)
/* Displays a bitmap picture loaded in the internal Flash. */ void hx8347i_DrawBitmap(uint16_t Xpos, uint16_t Ypos, uint8_t *pbmp)
{ uint32_t index = 0, size = 0; size = *(volatile uint16_t *) (pbmp + 2); size |= (*(volatile uint16_t *) (pbmp + 4)) << 16; index = *(volatile uint16_t *) (pbmp + 10); index |= (*(volatile uint16_t *) (pbmp + 12)) << 16; size = (size - index)/2; pbmp += index; hx8347i_WriteReg(LCD_REG_22, 0xE0); hx8347i_SetCursor(Xpos, Ypos); LCD_IO_WriteReg(LCD_REG_34); LCD_IO_WriteMultipleData((uint8_t*)pbmp, size*2); hx8347i_WriteReg(LCD_REG_22, 0xA0); }
eclipse-threadx/getting-started
C++
Other
310
/* Allocate a memory block from a memory pool. */
void* sysPoolAlloc(osPoolId pool_id)
/* Allocate a memory block from a memory pool. */ void* sysPoolAlloc(osPoolId pool_id)
{ return NULL; } mem = rt_alloc_box(pool_id); return mem; }
labapart/polymcu
C++
null
201
/* Checks whether the specified interrupt has occurred or not. */
uint8_t DMA_ReadIntFlag(DMA_INT_FLAG_T flag)
/* Checks whether the specified interrupt has occurred or not. */ uint8_t DMA_ReadIntFlag(DMA_INT_FLAG_T flag)
{ uint32_t status; if ((flag & 0x10000000) == SET) { status = DMA2->INTSTS & ((uint32_t)flag & 0x000FFFFF); } else { status = DMA1->INTSTS & ((uint32_t)flag & 0x0FFFFFFF); } if (status == flag) { return SET; } return RESET; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Address operands are always used in instructions that control program flow, because they ensure that the UDVM bytecode is position- independent code (i.e., it will run independently of where it is placed in the UDVM memory). */
static int decode_udvm_address_operand(guint8 *buff, guint operand_address, guint16 *value, guint current_address)
/* Address operands are always used in instructions that control program flow, because they ensure that the UDVM bytecode is position- independent code (i.e., it will run independently of where it is placed in the UDVM memory). */ static int decode_udvm_address_operand(guint8 *buff, guint operand_address, guint16 *value, guint current_address)
{ guint32 result; guint16 value1; guint next_opreand_address; next_opreand_address = decode_udvm_multitype_operand(buff, operand_address, &value1); result = value1 & 0xffff; result = result + current_address; *value = result & 0xffff; return next_opreand_address; }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* The input JSON value should not be NULL or contain no JSON integer, otherwise it will ASSERT() and return 0. */
INT64 EFIAPI JsonValueGetInteger(IN EDKII_JSON_VALUE Json)
/* The input JSON value should not be NULL or contain no JSON integer, otherwise it will ASSERT() and return 0. */ INT64 EFIAPI JsonValueGetInteger(IN EDKII_JSON_VALUE Json)
{ ASSERT (Json != NULL && JsonValueIsInteger (Json)); if ((Json == NULL) || !JsonValueIsInteger (Json)) { return 0; } return json_integer_value ((json_t *)Json); }
tianocore/edk2
C++
Other
4,240
/* 6.. FMS Start (Confirmed Service Id = 19) 6..1. Request Message Parameters */
static void dissect_ff_msg_fms_start_pi_req(tvbuff_t *tvb, gint offset, guint32 length, packet_info *pinfo, proto_tree *tree)
/* 6.. FMS Start (Confirmed Service Id = 19) 6..1. Request Message Parameters */ static void dissect_ff_msg_fms_start_pi_req(tvbuff_t *tvb, gint offset, guint32 length, packet_info *pinfo, proto_tree *tree)
{ proto_tree *sub_tree; col_set_str(pinfo->cinfo, COL_INFO, "FMS Start Request"); if (!tree) { return; } sub_tree = proto_tree_add_subtree(tree, tvb, offset, length, ett_ff_fms_start_req, NULL, "FMS Start Request"); proto_tree_add_item(sub_tree, hf_ff_fms_start_req_idx, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; length -= 4; if (length) { proto_tree_add_item(sub_tree, hf_ff_fms_start_req_execution_argument, tvb, offset, length, ENC_NA); } }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* param selection The clock source to be output, please refer to clock_output1_selection_t. param divider The divider of the output clock signal, please refer to clock_output_divider_t. */
void CLOCK_SetClockOutput1(clock_output1_selection_t selection, clock_output_divider_t divider)
/* param selection The clock source to be output, please refer to clock_output1_selection_t. param divider The divider of the output clock signal, please refer to clock_output_divider_t. */ void CLOCK_SetClockOutput1(clock_output1_selection_t selection, clock_output_divider_t divider)
{ uint32_t tmp32; tmp32 = CCM->CCOSR; if (selection == kCLOCK_DisableClockOutput1) { tmp32 &= ~CCM_CCOSR_CLKO1_EN_MASK; } else { tmp32 |= CCM_CCOSR_CLKO1_EN_MASK; tmp32 &= ~(CCM_CCOSR_CLKO1_SEL_MASK | CCM_CCOSR_CLKO1_DIV_MASK); tmp32 |= CCM_CCOSR_CLKO1_SEL(selection) | CCM_CCOSR_CLKO1_DIV(divider); } CCM->CCOSR = tmp32; }
eclipse-threadx/getting-started
C++
Other
310
/* This function will be invoked by BSP, when leave interrupt service routine. */
rt_weak void rt_interrupt_leave(void)
/* This function will be invoked by BSP, when leave interrupt service routine. */ rt_weak void rt_interrupt_leave(void)
{ LOG_D("irq is going to leave, irq current nest:%d", (rt_int32_t)rt_atomic_load(&(rt_interrupt_nest))); RT_OBJECT_HOOK_CALL(rt_interrupt_leave_hook,()); rt_atomic_sub(&(rt_interrupt_nest), 1); }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* The timer is currently only used to send queued packets to the tty in cases where the protocol provides no own handshaking to initiate the transfer. */
static void timeout_handler(unsigned long data)
/* The timer is currently only used to send queued packets to the tty in cases where the protocol provides no own handshaking to initiate the transfer. */ static void timeout_handler(unsigned long data)
{ struct garmin_data *garmin_data_p = (struct garmin_data *) data; if (garmin_data_p->mode == MODE_NATIVE) if (garmin_data_p->flags & FLAGS_QUEUING) garmin_flush_queue(garmin_data_p); }
robutest/uclinux
C++
GPL-2.0
60
/* DMA Channel Set the Peripheral Address. Set the address of the peripheral register to or from which data is to be transferred. Refer to the documentation for the specific peripheral. */
void dma_set_peripheral_address(uint32_t dma, uint8_t channel, uint32_t address)
/* DMA Channel Set the Peripheral Address. Set the address of the peripheral register to or from which data is to be transferred. Refer to the documentation for the specific peripheral. */ void dma_set_peripheral_address(uint32_t dma, uint8_t channel, uint32_t address)
{ if (!(DMA_CCR(dma, channel) & DMA_CCR_EN)) { DMA_CPAR(dma, channel) = (uint32_t) address; } }
insane-adding-machines/unicore-mx
C++
GNU General Public License v3.0
50
/* XXX we assume a % b < 0 iff a < 0, but this is actually machine-dependent. */
quad_t __moddi3(quad_t a, quad_t b)
/* XXX we assume a % b < 0 iff a < 0, but this is actually machine-dependent. */ quad_t __moddi3(quad_t a, quad_t b)
{ u_quad_t ua, ub, ur; int neg = 0; ua = a; ub = b; if (a < 0) { ua = -ua; neg = 1; } if (b < 0) { ub = -ub; } (void) __qdivrem(ua, ub, &ur); if (neg) { ur = -ur; } return ur; }
labapart/polymcu
C++
null
201
/* @bus: Bus to probe @chip_addr: Chip address to probe @flags: Flags for the chip */
static int i2c_probe_chip(struct udevice *bus, uint chip_addr, enum dm_i2c_chip_flags chip_flags)
/* @bus: Bus to probe @chip_addr: Chip address to probe @flags: Flags for the chip */ static int i2c_probe_chip(struct udevice *bus, uint chip_addr, enum dm_i2c_chip_flags chip_flags)
{ struct dm_i2c_ops *ops = i2c_get_ops(bus); struct i2c_msg msg[1]; int ret; if (ops->probe_chip) { ret = ops->probe_chip(bus, chip_addr, chip_flags); if (!ret || ret != -ENOSYS) return ret; } if (!ops->xfer) return -ENOSYS; msg->addr = chip_addr; msg->flags = chip_flags & DM_I2C_CHIP_10BIT ? I2C_M_TEN : 0; msg->len = 0; msg->buf = NULL; return ops->xfer(bus, msg, 1); }
4ms/stm32mp1-baremetal
C++
Other
137
/* get_indexed_reg - Get indexed register @hwif: for the port address @index: index of the indexed register */
static u8 get_indexed_reg(ide_hwif_t *hwif, u8 index)
/* get_indexed_reg - Get indexed register @hwif: for the port address @index: index of the indexed register */ static u8 get_indexed_reg(ide_hwif_t *hwif, u8 index)
{ u8 value; outb(index, hwif->dma_base + 1); value = inb(hwif->dma_base + 3); DBG("index[%02X] value[%02X]\n", index, value); return value; }
robutest/uclinux
C++
GPL-2.0
60
/* This is a "chunked memcpy". It does not manipulate any counters. */
static unsigned int mon_copy_to_buff(const struct mon_reader_bin *this, unsigned int off, const unsigned char *from, unsigned int length)
/* This is a "chunked memcpy". It does not manipulate any counters. */ static unsigned int mon_copy_to_buff(const struct mon_reader_bin *this, unsigned int off, const unsigned char *from, unsigned int length)
{ unsigned int step_len; unsigned char *buf; unsigned int in_page; while (length) { step_len = length; in_page = CHUNK_SIZE - (off & (CHUNK_SIZE-1)); if (in_page < step_len) step_len = in_page; buf = this->b_vec[off / CHUNK_SIZE].ptr + off % CHUNK_SIZE; memcpy(buf, from, step_len); if ((off += step_len) >= this->b_size) off = 0; from += step_len; length -= step_len; } return off; }
robutest/uclinux
C++
GPL-2.0
60
/* Check if the device instance of the selected address is already registered and return its index */
static uint8_t ft6x06_GetInstance(uint16_t DeviceAddr)
/* Check if the device instance of the selected address is already registered and return its index */ static uint8_t ft6x06_GetInstance(uint16_t DeviceAddr)
{ uint8_t idx = 0; for(idx = 0; idx < FT6x06_MAX_INSTANCE ; idx ++) { if(ft6x06[idx] == DeviceAddr) { return idx; } } return 0xFF; }
eclipse-threadx/getting-started
C++
Other
310
/* Note: may block (uninterruptible) if error recovery is underway on this disk. */
static int sd_release(struct gendisk *disk, fmode_t mode)
/* Note: may block (uninterruptible) if error recovery is underway on this disk. */ static int sd_release(struct gendisk *disk, fmode_t mode)
{ struct scsi_disk *sdkp = scsi_disk(disk); struct scsi_device *sdev = sdkp->device; SCSI_LOG_HLQUEUE(3, sd_printk(KERN_INFO, sdkp, "sd_release\n")); if (!--sdkp->openers && sdev->removable) { if (scsi_block_when_processing_errors(sdev)) scsi_set_medium_removal(sdev, SCSI_REMOVAL_ALLOW); } scsi_disk_put(sdkp); return 0; }
robutest/uclinux
C++
GPL-2.0
60
/* Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: */
SDL_TLSID SDL_TLSCreate()
/* Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: */ SDL_TLSID SDL_TLSCreate()
{ static SDL_atomic_t SDL_tls_id; return SDL_AtomicIncRef(&SDL_tls_id)+1; }
alibaba/AliOS-Things
C++
Apache License 2.0
4,536
/* Register an AMBA device driver with the Linux device model core. If devices pre-exist, the drivers probe function will be called. */
int amba_driver_register(struct amba_driver *drv)
/* Register an AMBA device driver with the Linux device model core. If devices pre-exist, the drivers probe function will be called. */ int amba_driver_register(struct amba_driver *drv)
{ drv->drv.bus = &amba_bustype; #define SETFN(fn) if (drv->fn) drv->drv.fn = amba_##fn SETFN(probe); SETFN(remove); SETFN(shutdown); return driver_register(&drv->drv); }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Written by Sven Verdoolaege, K.U.Leuven, Departement Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium */
void isl_handle_error(isl_ctx *ctx, enum isl_error error, const char *msg, const char *file, int line)
/* Written by Sven Verdoolaege, K.U.Leuven, Departement Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium */ void isl_handle_error(isl_ctx *ctx, enum isl_error error, const char *msg, const char *file, int line)
{ isl_ctx_set_error(ctx, error); switch (isl_options_get_on_error(ctx)) { case ISL_ON_ERROR_WARN: fprintf(stderr, "%s:%d: %s\n", file, line, msg); return; case ISL_ON_ERROR_CONTINUE: return; case ISL_ON_ERROR_ABORT: fprintf(stderr, "%s:%d: %s\n", file, line, msg); abort(); return; } }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* SPI Enable Transmit Transfers via DMA. This allows transmissions to proceed unattended using DMA to move data to the transmit buffer as it becomes available. The DMA channels provided for each SPI peripheral are given in the Technical Manual DMA section. */
void spi_enable_tx_dma(uint32_t spi)
/* SPI Enable Transmit Transfers via DMA. This allows transmissions to proceed unattended using DMA to move data to the transmit buffer as it becomes available. The DMA channels provided for each SPI peripheral are given in the Technical Manual DMA section. */ void spi_enable_tx_dma(uint32_t spi)
{ SPI_CR2(spi) |= SPI_CR2_TXDMAEN; }
insane-adding-machines/unicore-mx
C++
GNU General Public License v3.0
50
/* Registers the callback function that this server calls, whenever a client requests the reading of a specific input register. */
void TbxMbServerSetCallbackReadInputReg(tTbxMbServer channel, tTbxMbServerReadInputReg callback)
/* Registers the callback function that this server calls, whenever a client requests the reading of a specific input register. */ void TbxMbServerSetCallbackReadInputReg(tTbxMbServer channel, tTbxMbServerReadInputReg callback)
{ TBX_ASSERT((channel != NULL) && (callback != NULL)); if ((channel != NULL) && (callback != NULL)) { tTbxMbServerCtx * serverCtx = (tTbxMbServerCtx *)channel; TBX_ASSERT(serverCtx->type == TBX_MB_SERVER_CONTEXT_TYPE); TbxCriticalSectionEnter(); serverCtx->readInputRegFcn = callback; TbxCriticalSectionExit(); } }
feaser/openblt
C++
GNU General Public License v3.0
601
/* De-Initializes the Low Level portion of the Device driver. */
USBD_StatusTypeDef USBD_LL_DeInit(USBD_HandleTypeDef *pdev)
/* De-Initializes the Low Level portion of the Device driver. */ USBD_StatusTypeDef USBD_LL_DeInit(USBD_HandleTypeDef *pdev)
{ HAL_PCD_DeInit(pdev->pData); return USBD_OK; }
STMicroelectronics/STM32CubeF4
C++
Other
789
/* sunxi_lcd_tcon_enable - enable timing controller. @screen_id: The index of screen. */
void sunxi_lcd_tcon_enable(u32 screen_id)
/* sunxi_lcd_tcon_enable - enable timing controller. @screen_id: The index of screen. */ void sunxi_lcd_tcon_enable(u32 screen_id)
{ if (g_lcd_drv.src_ops.sunxi_lcd_tcon_enable) g_lcd_drv.src_ops.sunxi_lcd_tcon_enable(screen_id); }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* If 32-bit MMIO register operations are not supported, then ASSERT(). */
UINT32 EFIAPI S3MmioWrite32(IN UINTN Address, IN UINT32 Value)
/* If 32-bit MMIO register operations are not supported, then ASSERT(). */ UINT32 EFIAPI S3MmioWrite32(IN UINTN Address, IN UINT32 Value)
{ return InternalSaveMmioWrite32ValueToBootScript (Address, MmioWrite32 (Address, Value)); }
tianocore/edk2
C++
Other
4,240
/* USBH_MSC_UnitIsReady The function check whether a LUN is ready. */
uint8_t USBH_MSC_UnitIsReady(USBH_HandleTypeDef *phost, uint8_t lun)
/* USBH_MSC_UnitIsReady The function check whether a LUN is ready. */ uint8_t USBH_MSC_UnitIsReady(USBH_HandleTypeDef *phost, uint8_t lun)
{ if ((phost->device.is_connected == 0U) || (phost->gState != HOST_CLASS)) { return 0; } if (phost->pActiveClass == NULL || phost->pActiveClass->pData == NULL) { return 0; } MSC_HandleTypeDef *MSC_Handle = (MSC_HandleTypeDef*) phost->pActiveClass->pData; uint8_t res; if ((phost->gState == HOST_CLASS) && (MSC_Handle->unit [lun].error == MSC_OK)) { res = 1U; } else { res = 0U; } return res; }
ua1arn/hftrx
C++
null
69
/* USBH_MTP_GetNumStorage Select the storage Unit to be used. */
USBH_StatusTypeDef USBH_MTP_GetNumStorage(USBH_HandleTypeDef *phost, uint8_t *storage_num)
/* USBH_MTP_GetNumStorage Select the storage Unit to be used. */ USBH_StatusTypeDef USBH_MTP_GetNumStorage(USBH_HandleTypeDef *phost, uint8_t *storage_num)
{ USBH_StatusTypeDef status = USBH_FAIL; MTP_HandleTypeDef *MTP_Handle = (MTP_HandleTypeDef *)phost->pActiveClass->pData; if (MTP_Handle->is_ready > 0U) { *storage_num = (uint8_t)MTP_Handle->info.storids.n; status = USBH_OK; } return status; }
ua1arn/hftrx
C++
null
69
/* Note that this function occupies KM_USER0 if @atomic != 0. */
void* generic_pipe_buf_map(struct pipe_inode_info *pipe, struct pipe_buffer *buf, int atomic)
/* Note that this function occupies KM_USER0 if @atomic != 0. */ void* generic_pipe_buf_map(struct pipe_inode_info *pipe, struct pipe_buffer *buf, int atomic)
{ if (atomic) { buf->flags |= PIPE_BUF_FLAG_ATOMIC; return kmap_atomic(buf->page, KM_USER0); } return kmap(buf->page); }
robutest/uclinux
C++
GPL-2.0
60
/* Checks whether the specified interrupt has occurred or not. */
ITStatus SPI_GetITStatus(SPI_TypeDef *SPIx, SPI_IT_TypeDef SPI_IT)
/* Checks whether the specified interrupt has occurred or not. */ ITStatus SPI_GetITStatus(SPI_TypeDef *SPIx, SPI_IT_TypeDef SPI_IT)
{ ITStatus pendingbitstatus = RESET; uint8_t itpos = 0; uint8_t itmask1 = 0; uint8_t itmask2 = 0; __IO uint8_t enablestatus = 0; assert_param(IS_SPI_GET_IT(SPI_IT)); itpos = (uint8_t)((uint8_t)1 << ((uint8_t)SPI_IT & (uint8_t)0x0F)); itmask1 = (uint8_t)((uint8_t)SPI_IT >> (uint8_t)4); itmask2 = (uint8_t)((uint8_t)1 << itmask1); enablestatus = (uint8_t)((uint8_t)SPIx->SR & itmask2); if (((SPIx->CR3 & itpos) != RESET) && enablestatus) { pendingbitstatus = SET; } else { pendingbitstatus = RESET; } return pendingbitstatus; }
remotemcu/remcu-chip-sdks
C++
null
436
/* this is the low level routine to read/write a bit on the One Wire interface on the hardware. It does write 0 if parameter bit is set to 0, otherwise a write 1/read. */
static u8 mxc_w1_touch_bit(struct mxc_w1_pdata *pdata, u8 bit)
/* this is the low level routine to read/write a bit on the One Wire interface on the hardware. It does write 0 if parameter bit is set to 0, otherwise a write 1/read. */ static u8 mxc_w1_touch_bit(struct mxc_w1_pdata *pdata, u8 bit)
{ u16 *ctrl_addr = &pdata->regs->control; u16 mask = MXC_W1_CONTROL_WR(bit); unsigned int timeout_cnt = 400; writew(mask, ctrl_addr); while (timeout_cnt--) { if (!(readw(ctrl_addr) & mask)) break; udelay(1); } return (readw(ctrl_addr) & MXC_W1_CONTROL_RDST) ? 1 : 0; }
4ms/stm32mp1-baremetal
C++
Other
137
/* does not yet catch signals sent when the child dies. in exit.c or in signal.c. */
static int read_long(struct task_struct *tsk, unsigned long addr, unsigned long *result)
/* does not yet catch signals sent when the child dies. in exit.c or in signal.c. */ static int read_long(struct task_struct *tsk, unsigned long addr, unsigned long *result)
{ *result = *(unsigned long *)addr; return 0; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* zfcp_ccw_priv_sch - check if subchannel is privileged @adapter: Adapter/Subchannel to check */
int zfcp_ccw_priv_sch(struct zfcp_adapter *adapter)
/* zfcp_ccw_priv_sch - check if subchannel is privileged @adapter: Adapter/Subchannel to check */ int zfcp_ccw_priv_sch(struct zfcp_adapter *adapter)
{ return adapter->ccw_device->id.dev_model == ZFCP_MODEL_PRIV; }
robutest/uclinux
C++
GPL-2.0
60
/* Checks whether the specified SDIO interrupt has occurred or not. */
ITStatus SDIO_GetITStatus(uint32_t SDIO_IT)
/* Checks whether the specified SDIO interrupt has occurred or not. */ ITStatus SDIO_GetITStatus(uint32_t SDIO_IT)
{ ITStatus bitstatus = RESET; assert_param(IS_SDIO_GET_IT(SDIO_IT)); if ((SDIO->STA & SDIO_IT) != (uint32_t)RESET) { bitstatus = SET; } else { bitstatus = RESET; } return bitstatus; }
gcallipo/RadioDSP-Stm32f103
C++
Common Creative - Attribution 3.0
51
/* Reset the input device and optionally run diagnostics */
EFI_STATUS EFIAPI KeyboardEfiResetEx(IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
/* Reset the input device and optionally run diagnostics */ EFI_STATUS EFIAPI KeyboardEfiResetEx(IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
{ KEYBOARD_CONSOLE_IN_DEV *ConsoleInDev; ConsoleInDev = TEXT_INPUT_EX_KEYBOARD_CONSOLE_IN_DEV_FROM_THIS (This); return ConsoleInDev->ConIn.Reset ( &ConsoleInDev->ConIn, ExtendedVerification ); }
tianocore/edk2
C++
Other
4,240
/* link_insert_deferred_queue - insert deferred messages back into receive chain */
static struct sk_buff* link_insert_deferred_queue(struct link *l_ptr, struct sk_buff *buf)
/* link_insert_deferred_queue - insert deferred messages back into receive chain */ static struct sk_buff* link_insert_deferred_queue(struct link *l_ptr, struct sk_buff *buf)
{ u32 seq_no; if (l_ptr->oldest_deferred_in == NULL) return buf; seq_no = msg_seqno(buf_msg(l_ptr->oldest_deferred_in)); if (seq_no == mod(l_ptr->next_in_no)) { l_ptr->newest_deferred_in->next = buf; buf = l_ptr->oldest_deferred_in; l_ptr->oldest_deferred_in = NULL; l_ptr->deferred_inqueue_sz = 0; } return buf; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* USBH_USR_Init Displays the message on LCD for host lib initialization. */
void USBH_USR_Init(void)
/* USBH_USR_Init Displays the message on LCD for host lib initialization. */ void USBH_USR_Init(void)
{ static uint8_t startup = 0; if(startup == 0 ) { startup = 1; STM_EVAL_LEDInit(LED3); STM_EVAL_LEDInit(LED4); STM_EVAL_LEDInit(LED5); STM_EVAL_LEDInit(LED6); STM_EVAL_PBInit(BUTTON_USER, BUTTON_MODE_GPIO); } if (SysTick_Config(SystemCoreClock / 1000)) { while (1); } }
remotemcu/remcu-chip-sdks
C++
null
436
/* Also, we KNOW that for the non error case of */
static unsigned long __apm_irq_save(void)
/* Also, we KNOW that for the non error case of */ static unsigned long __apm_irq_save(void)
{ unsigned long flags; local_save_flags(flags); if (apm_info.allow_ints) { if (irqs_disabled_flags(flags)) local_irq_enable(); } else local_irq_disable(); return flags; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* release an RxRPC BSD socket on close() or equivalent */
static int rxrpc_release(struct socket *sock)
/* release an RxRPC BSD socket on close() or equivalent */ static int rxrpc_release(struct socket *sock)
{ struct sock *sk = sock->sk; _enter("%p{%p}", sock, sk); if (!sk) return 0; sock->sk = NULL; return rxrpc_release_sock(sk); }
EmcraftSystems/linux-emcraft
C++
Other
266
/* @reason: Pointer to returned reason string @response: Pointer to fastboot response buffer */
void fastboot_fail(const char *reason, char *response)
/* @reason: Pointer to returned reason string @response: Pointer to fastboot response buffer */ void fastboot_fail(const char *reason, char *response)
{ fastboot_response("FAIL", response, "%s", reason); }
4ms/stm32mp1-baremetal
C++
Other
137
/* Returns the new list of CRAdditionalSel or NULL if an error arises. */
CRAdditionalSel* cr_additional_sel_prepend(CRAdditionalSel *a_this, CRAdditionalSel *a_sel)
/* Returns the new list of CRAdditionalSel or NULL if an error arises. */ CRAdditionalSel* cr_additional_sel_prepend(CRAdditionalSel *a_this, CRAdditionalSel *a_sel)
{ g_return_val_if_fail (a_sel, NULL); if (a_this == NULL) { return a_sel; } a_sel->next = a_this; a_this->prev = a_sel; return a_sel; }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* If the key already exists in the #GHashTable its current value is replaced with the new value. If you supplied a @value_destroy_func when creating the #GHashTable, the old value is freed using that function. If you supplied a @key_destroy_func when creating the #GHashTable, the passed key is freed using that function. */
void g_hash_table_insert(GHashTable *hash_table, gpointer key, gpointer value)
/* If the key already exists in the #GHashTable its current value is replaced with the new value. If you supplied a @value_destroy_func when creating the #GHashTable, the old value is freed using that function. If you supplied a @key_destroy_func when creating the #GHashTable, the passed key is freed using that function. */ void g_hash_table_insert(GHashTable *hash_table, gpointer key, gpointer value)
{ GHashNode **node; g_return_if_fail (hash_table != NULL); g_return_if_fail (hash_table->ref_count > 0); node = g_hash_table_lookup_node (hash_table, key); if (*node) { if (hash_table->key_destroy_func) hash_table->key_destroy_func (key); if (hash_table->value_destroy_func) hash_table->value_destroy_func ((*node)->value); (*node)->value = value; } else { *node = g_hash_node_new (key, value); hash_table->nnodes++; G_HASH_TABLE_RESIZE (hash_table); } }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* Asynchronously retrieves the next #GSocketAddress from @enumerator and then calls @callback, which must call g_socket_address_enumerator_next_finish() to get the result. */
void g_socket_address_enumerator_next_async(GSocketAddressEnumerator *enumerator, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
/* Asynchronously retrieves the next #GSocketAddress from @enumerator and then calls @callback, which must call g_socket_address_enumerator_next_finish() to get the result. */ void g_socket_address_enumerator_next_async(GSocketAddressEnumerator *enumerator, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
{ GSocketAddressEnumeratorClass *klass; g_return_if_fail (G_IS_SOCKET_ADDRESS_ENUMERATOR (enumerator)); klass = G_SOCKET_ADDRESS_ENUMERATOR_GET_CLASS (enumerator); (* klass->next_async) (enumerator, cancellable, callback, user_data); }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* This is the Event call back function to notify the Library the system is entering SmmLocked phase. */
VOID EFIAPI S3BootScriptEventCallBack(IN EFI_EVENT Event, IN VOID *Context)
/* This is the Event call back function to notify the Library the system is entering SmmLocked phase. */ VOID EFIAPI S3BootScriptEventCallBack(IN EFI_EVENT Event, IN VOID *Context)
{ EFI_STATUS Status; VOID *Interface; Status = gBS->LocateProtocol ( &gEfiDxeSmmReadyToLockProtocolGuid, NULL, &Interface ); if (EFI_ERROR (Status)) { return; } if (!mS3BootScriptTablePtr->SmmLocked) { S3BootScriptInternalCloseTable (); mS3BootScriptTablePtr->SmmLocked = TRUE; SaveBootScriptDataToLockBox (); } }
tianocore/edk2
C++
Other
4,240
/* Set block size of SDIO function. Set desired block size for SDIO function, used by block transfers to SDIO registers. */
int sdio_set_block_size(struct sdio_func *func, uint16_t bsize)
/* Set block size of SDIO function. Set desired block size for SDIO function, used by block transfers to SDIO registers. */ int sdio_set_block_size(struct sdio_func *func, uint16_t bsize)
{ int ret; uint8_t reg; if (func->cis.max_blk_size < bsize) { return -EINVAL; } for (int i = 0; i < 2; i++) { reg = (bsize >> (i * 8)); ret = sdio_io_rw_direct(func->card, SDIO_IO_WRITE, SDIO_FUNC_NUM_0, SDIO_FBR_BASE(func->num) + SDIO_FBR_BLK_SIZE + i, reg, NULL); if (ret) { return ret; } } func->block_size = bsize; return 0; }
zephyrproject-rtos/zephyr
C++
Apache License 2.0
9,573
/* Clears the I2C bus by sending nine clock pulses. Used when data line is stuck low. */
static void ixgbe_i2c_bus_clear(struct ixgbe_hw *hw)
/* Clears the I2C bus by sending nine clock pulses. Used when data line is stuck low. */ static void ixgbe_i2c_bus_clear(struct ixgbe_hw *hw)
{ u32 i2cctl = IXGBE_READ_REG(hw, IXGBE_I2CCTL); u32 i; ixgbe_set_i2c_data(hw, &i2cctl, 1); for (i = 0; i < 9; i++) { ixgbe_raise_i2c_clk(hw, &i2cctl); udelay(IXGBE_I2C_T_HIGH); ixgbe_lower_i2c_clk(hw, &i2cctl); udelay(IXGBE_I2C_T_LOW); } ixgbe_i2c_stop(hw); }
robutest/uclinux
C++
GPL-2.0
60
/* brief system clocks enable controls. param mask : system clocks enable value return Nothing */
void CLOCK_SetupClockCtrl(uint32_t mask)
/* brief system clocks enable controls. param mask : system clocks enable value return Nothing */ void CLOCK_SetupClockCtrl(uint32_t mask)
{ SYSCON->CLOCK_CTRL |= mask; return; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* ISR handler for a specific vector index in the interrupt vector table for linking the actual interrupts vectors to the one in the user program's vector table. */
void Vector47_handler(void)
/* ISR handler for a specific vector index in the interrupt vector table for linking the actual interrupts vectors to the one in the user program's vector table. */ void Vector47_handler(void)
{ asm { LDX(VCT_USER_PROGRAM_VECTOR_TABLE_STARTADDR + (47 * 2)) JMP 0,X } }
feaser/openblt
C++
GNU General Public License v3.0
601
/* Disables the generation of the waveform signal on the designated output(s) Outputs can be combined (ORed) to allow for simultaneous output disabling. */
void HRTIM_WaveformOutputStop(HRTIM_TypeDef *HRTIMx, uint32_t OutputsToStop)
/* Disables the generation of the waveform signal on the designated output(s) Outputs can be combined (ORed) to allow for simultaneous output disabling. */ void HRTIM_WaveformOutputStop(HRTIM_TypeDef *HRTIMx, uint32_t OutputsToStop)
{ HRTIMx->HRTIM_COMMON.DISR = OutputsToStop; }
remotemcu/remcu-chip-sdks
C++
null
436
/* Start the tcw on the given subchannel. Return zero on success, non-zero otherwise. */
int cio_tm_start_key(struct subchannel *sch, struct tcw *tcw, u8 lpm, u8 key)
/* Start the tcw on the given subchannel. Return zero on success, non-zero otherwise. */ int cio_tm_start_key(struct subchannel *sch, struct tcw *tcw, u8 lpm, u8 key)
{ int cc; union orb *orb = &to_io_private(sch)->orb; memset(orb, 0, sizeof(union orb)); orb->tm.intparm = (u32) (addr_t) sch; orb->tm.key = key >> 4; orb->tm.b = 1; orb->tm.lpm = lpm ? lpm : sch->lpm; orb->tm.tcw = (u32) (addr_t) tcw; cc = ssch(sch->schid, orb); switch (cc) { case 0: return 0; case 1: case 2: return -EBUSY; default: return cio_start_handle_notoper(sch, lpm); } }
robutest/uclinux
C++
GPL-2.0
60
/* Message: StopSessionTransmissionMessage Opcode: 0x0096 Type: IntraCCM Direction: pbx2pbx VarLength: no */
static void handle_StopSessionTransmissionMessage(ptvcursor_t *cursor, packet_info *pinfo _U_)
/* Message: StopSessionTransmissionMessage Opcode: 0x0096 Type: IntraCCM Direction: pbx2pbx VarLength: no */ static void handle_StopSessionTransmissionMessage(ptvcursor_t *cursor, packet_info *pinfo _U_)
{ dissect_skinny_ipv4or6(cursor, hf_skinny_remoteIpAddr_ipv4, hf_skinny_remoteIpAddr_ipv6, pinfo); ptvcursor_add(cursor, hf_skinny_sessionType, 4, ENC_LITTLE_ENDIAN); }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* Sets the pulse width for the specified PWM output. */
void PWMPulseWidthSet(uint32_t ui32Base, uint32_t ui32PWMOut, uint32_t ui32Width)
/* Sets the pulse width for the specified PWM output. */ void PWMPulseWidthSet(uint32_t ui32Base, uint32_t ui32PWMOut, uint32_t ui32Width)
{ uint32_t ui32GenBase, ui32Reg; ASSERT(ui32Base == PWM0_BASE); ASSERT(_PWMOutValid(ui32PWMOut)); ui32GenBase = PWM_OUT_BADDR(ui32Base, ui32PWMOut); if (HWREG(ui32GenBase + PWM_O_X_CTL) & PWM_X_CTL_MODE) { ui32Width /= 2; } ui32Reg = HWREG(ui32GenBase + PWM_O_X_LOAD); ASSERT(ui32Width < ui32Reg); ui32Reg = ui32Reg - ui32Width; if (PWM_IS_OUTPUT_ODD(ui32PWMOut)) { HWREG(ui32GenBase + PWM_O_X_CMPB) = ui32Reg; } else { HWREG(ui32GenBase + PWM_O_X_CMPA) = ui32Reg; } }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Writes a single byte to the NVM using the flash access registers. */
static s32 e1000_write_flash_byte_ich8lan(struct e1000_hw *hw, u32 offset, u8 data)
/* Writes a single byte to the NVM using the flash access registers. */ static s32 e1000_write_flash_byte_ich8lan(struct e1000_hw *hw, u32 offset, u8 data)
{ u16 word = (u16)data; return e1000_write_flash_data_ich8lan(hw, offset, 1, word); }
robutest/uclinux
C++
GPL-2.0
60
/* Attribute write call back for the Descriptor V9D2 (128-bit UUID) attribute. */
static ssize_t write_des_v9d2__128_bit_uuid(struct bt_conn *conn, const struct bt_gatt_attr *attr, const void *buf, uint16_t len, uint16_t offset, uint8_t flags)
/* Attribute write call back for the Descriptor V9D2 (128-bit UUID) attribute. */ static ssize_t write_des_v9d2__128_bit_uuid(struct bt_conn *conn, const struct bt_gatt_attr *attr, const void *buf, uint16_t len, uint16_t offset, uint8_t flags)
{ uint8_t *value = attr->user_data; if (offset >= sizeof(des_v9d2__128_bit_uuid_value)) return BT_GATT_ERR(BT_ATT_ERR_INVALID_OFFSET); if (offset + len > sizeof(des_v9d2__128_bit_uuid_value)) return BT_GATT_ERR(BT_ATT_ERR_INVALID_ATTRIBUTE_LEN); memcpy(value + offset, buf, len); return len; }
zephyrproject-rtos/zephyr
C++
Apache License 2.0
9,573
/* Unregisters a callback. Unregisters a callback function, which is implemented by the user. */
void usart_unregister_callback(struct usart_module *const module, enum usart_callback callback_type)
/* Unregisters a callback. Unregisters a callback function, which is implemented by the user. */ void usart_unregister_callback(struct usart_module *const module, enum usart_callback callback_type)
{ Assert(module); module->callback[callback_type] = NULL; module->callback_reg_mask &= ~(1 << callback_type); }
memfault/zero-to-main
C++
null
200
/* Retrieve the Signature Algorithm from one X.509 certificate. */
BOOLEAN EFIAPI X509GetSignatureAlgorithm(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINT8 *Oid, OPTIONAL IN OUT UINTN *OidSize)
/* Retrieve the Signature Algorithm from one X.509 certificate. */ BOOLEAN EFIAPI X509GetSignatureAlgorithm(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINT8 *Oid, OPTIONAL IN OUT UINTN *OidSize)
{ CALL_CRYPTO_SERVICE (X509GetSignatureAlgorithm, (Cert, CertSize, Oid, OidSize), FALSE); }
tianocore/edk2
C++
Other
4,240
/* retval kStatus_Success Enable the System Low Voltage Detect successfully. */
status_t SPC_EnableActiveModeSystemLowVoltageDetect(SPC_Type *base, bool enable)
/* retval kStatus_Success Enable the System Low Voltage Detect successfully. */ status_t SPC_EnableActiveModeSystemLowVoltageDetect(SPC_Type *base, bool enable)
{ status_t status = kStatus_Success; if (enable) { base->ACTIVE_CFG |= SPC_ACTIVE_CFG_SYS_LVDE_MASK; } else { base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_SYS_LVDE_MASK; } return status; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* vpfe_lookup_pix_format() lookup an entry in the vpfe pix format table based on pix_format */
static const struct vpfe_pixel_format* vpfe_lookup_pix_format(u32 pix_format)
/* vpfe_lookup_pix_format() lookup an entry in the vpfe pix format table based on pix_format */ static const struct vpfe_pixel_format* vpfe_lookup_pix_format(u32 pix_format)
{ int i; for (i = 0; i < ARRAY_SIZE(vpfe_pix_fmts); i++) { if (pix_format == vpfe_pix_fmts[i].fmtdesc.pixelformat) return &vpfe_pix_fmts[i]; } return NULL; }
robutest/uclinux
C++
GPL-2.0
60
/* Used by a driver to check whether a */
static const struct pci_device_id* pci_match_device(struct pci_driver *drv, struct pci_dev *dev)
/* Used by a driver to check whether a */ static const struct pci_device_id* pci_match_device(struct pci_driver *drv, struct pci_dev *dev)
{ struct pci_dynid *dynid; spin_lock(&drv->dynids.lock); list_for_each_entry(dynid, &drv->dynids.list, node) { if (pci_match_one_device(&dynid->id, dev)) { spin_unlock(&drv->dynids.lock); return &dynid->id; } } spin_unlock(&drv->dynids.lock); return pci_match_id(drv->id_table, dev); }
robutest/uclinux
C++
GPL-2.0
60
/* Wrapper for _xfs_log_force(), to be used when caller doesn't care about errors or whether the log was flushed or not. This is the normal interface to use when trying to unpin items or move the log forward. */
void xfs_log_force(xfs_mount_t *mp, xfs_lsn_t lsn, uint flags)
/* Wrapper for _xfs_log_force(), to be used when caller doesn't care about errors or whether the log was flushed or not. This is the normal interface to use when trying to unpin items or move the log forward. */ void xfs_log_force(xfs_mount_t *mp, xfs_lsn_t lsn, uint flags)
{ int error; error = _xfs_log_force(mp, lsn, flags, NULL); if (error) { xfs_fs_cmn_err(CE_WARN, mp, "xfs_log_force: " "error %d returned.", error); } }
robutest/uclinux
C++
GPL-2.0
60
/* Called from process context only (admin command and worker). */
static int _drbd_resume_next(struct drbd_conf *mdev)
/* Called from process context only (admin command and worker). */ static int _drbd_resume_next(struct drbd_conf *mdev)
{ struct drbd_conf *odev; int i, rv = 0; for (i = 0; i < minor_count; i++) { odev = minor_to_mdev(i); if (!odev) continue; if (odev->state.conn == C_STANDALONE && odev->state.disk == D_DISKLESS) continue; if (odev->state.aftr_isp) { if (_drbd_may_sync_now(odev)) rv |= (__drbd_set_state(_NS(odev, aftr_isp, 0), CS_HARD, NULL) != SS_NOTHING_TO_DO) ; } } return rv; }
robutest/uclinux
C++
GPL-2.0
60
/* Derive SHA256 HMAC-based Expand Key Derivation Function (HKDF). */
BOOLEAN EFIAPI HkdfSha256Expand(IN CONST UINT8 *Prk, IN UINTN PrkSize, IN CONST UINT8 *Info, IN UINTN InfoSize, OUT UINT8 *Out, IN UINTN OutSize)
/* Derive SHA256 HMAC-based Expand Key Derivation Function (HKDF). */ BOOLEAN EFIAPI HkdfSha256Expand(IN CONST UINT8 *Prk, IN UINTN PrkSize, IN CONST UINT8 *Info, IN UINTN InfoSize, OUT UINT8 *Out, IN UINTN OutSize)
{ CALL_CRYPTO_SERVICE (HkdfSha256Expand, (Prk, PrkSize, Info, InfoSize, Out, OutSize), FALSE); }
tianocore/edk2
C++
Other
4,240
/* Configures the chopper mode feature for a timer. */
void HRTIM_ChopperModeConfig(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, HRTIM_ChopperModeCfgTypeDef *pChopperModeCfg)
/* Configures the chopper mode feature for a timer. */ void HRTIM_ChopperModeConfig(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, HRTIM_ChopperModeCfgTypeDef *pChopperModeCfg)
{ uint32_t HRTIM_chpr; assert_param(IS_HRTIM_TIMING_UNIT(TimerIdx)); HRTIM_chpr = HRTIMx->HRTIM_TIMERx[TimerIdx].CHPxR; HRTIM_chpr &= ~(HRTIM_CHPR_CARFRQ | HRTIM_CHPR_CARDTY | HRTIM_CHPR_STRPW); HRTIM_chpr |= pChopperModeCfg->CarrierFreq; HRTIM_chpr |= (pChopperModeCfg->DutyCycle << 4); HRTIM_chpr |= (pChopperModeCfg->StartPulse << 7); HRTIMx->HRTIM_TIMERx[TimerIdx].CHPxR = HRTIM_chpr; }
remotemcu/remcu-chip-sdks
C++
null
436