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
/* Enables or disables I2C Idle Clock Timeout (Bus idle SCL and SDA high detection). */
void I2C_IdleClockTimeoutCmd(I2C_TypeDef *I2Cx, FunctionalState NewState)
/* Enables or disables I2C Idle Clock Timeout (Bus idle SCL and SDA high detection). */ void I2C_IdleClockTimeoutCmd(I2C_TypeDef *I2Cx, FunctionalState NewState)
{ assert_param(IS_I2C_1_PERIPH(I2Cx)); assert_param(IS_FUNCTIONAL_STATE(NewState)); if (NewState != DISABLE) { I2Cx->TIMEOUTR |= I2C_TIMEOUTR_TIDLE; } else { I2Cx->TIMEOUTR &= (uint32_t)~((uint32_t)I2C_TIMEOUTR_TIDLE); } }
ajhc/demo-cortex-m3
C++
null
38
/* Initialize Question's Edit copy from Storage for the whole Formset. */
EFI_STATUS LoadFormSetConfig(IN OUT UI_MENU_SELECTION *Selection, IN FORM_BROWSER_FORMSET *FormSet)
/* Initialize Question's Edit copy from Storage for the whole Formset. */ EFI_STATUS LoadFormSetConfig(IN OUT UI_MENU_SELECTION *Selection, IN FORM_BROWSER_FORMSET *FormSet)
{ EFI_STATUS Status; LIST_ENTRY *Link; FORM_BROWSER_FORM *Form; Link = GetFirstNode (&FormSet->FormListHead); while (!IsNull (&FormSet->FormListHead, Link)) { Form = FORM_BROWSER_FORM_FROM_LINK (Link); Status = LoadFormConfig (Selection, FormSet, Form); if (EFI_ERROR (Status)) { return Status; } Link = GetNextNode (&FormSet->FormListHead, Link); } FormSet->QuestionInited = TRUE; return EFI_SUCCESS; }
tianocore/edk2
C++
Other
4,240
/* Offsets are specified to support either contiguous or discontiguous memory transfers, or repeated access to a hardware register, as needed. When accessing hardware registers, both offsets are normally zero. */
void edma3_set_dest_index(u32 base, unsigned slot, int bidx, int cidx)
/* Offsets are specified to support either contiguous or discontiguous memory transfers, or repeated access to a hardware register, as needed. When accessing hardware registers, both offsets are normally zero. */ void edma3_set_dest_index(u32 base, unsigned slot, int bidx, int cidx)
{ u32 src_dst_bidx; u32 src_dst_cidx; struct edma3_slot_layout *rg; rg = (struct edma3_slot_layout *)(base + EDMA3_SL_BASE(slot)); src_dst_bidx = __raw_readl(&rg->src_dst_bidx); src_dst_cidx = __raw_readl(&rg->src_dst_cidx); __raw_writel((src_dst_bidx & 0x0000ffff) | (bidx << 16), &rg->src_dst_bidx); __raw_writel((src_dst_cidx & 0x0000ffff) | (cidx << 16), &rg->src_dst_cidx); }
4ms/stm32mp1-baremetal
C++
Other
137
/* HASH Set Last Word Valid Bits. Specifies the number of valid bits in the last word. */
void hash_set_last_word_valid_bits(uint8_t validbits)
/* HASH Set Last Word Valid Bits. Specifies the number of valid bits in the last word. */ void hash_set_last_word_valid_bits(uint8_t validbits)
{ HASH_STR &= ~(HASH_STR_NBW); HASH_STR |= validbits; }
insane-adding-machines/unicore-mx
C++
GNU General Public License v3.0
50
/* Set virt_prcm_set's rate to the mpu_speed field of the current PRCM set. */
unsigned long omap2_table_mpu_recalc(struct clk *clk)
/* Set virt_prcm_set's rate to the mpu_speed field of the current PRCM set. */ unsigned long omap2_table_mpu_recalc(struct clk *clk)
{ return curr_prcm_set->mpu_speed; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* This function changes the attributes of a memory range to not allow writes. */
EFI_STATUS EFIAPI LegacyRegion2Lock(IN EFI_LEGACY_REGION2_PROTOCOL *This, IN UINT32 Start, IN UINT32 Length, OUT UINT32 *Granularity)
/* This function changes the attributes of a memory range to not allow writes. */ EFI_STATUS EFIAPI LegacyRegion2Lock(IN EFI_LEGACY_REGION2_PROTOCOL *This, IN UINT32 Start, IN UINT32 Length, OUT UINT32 *Granularity)
{ if ((Start < 0xC0000) || ((Start + Length - 1) > 0xFFFFF)) { return EFI_INVALID_PARAMETER; } ASSERT (Granularity != NULL); *Granularity = 0; return EFI_SUCCESS; }
tianocore/edk2
C++
Other
4,240
/* Note the function prototype use msgid as the 2nd parameter, here we take it as no_resp. */
static int imx8_scu_call(struct udevice *dev, int no_resp, void *tx_msg, int tx_size, void *rx_msg, int rx_size)
/* Note the function prototype use msgid as the 2nd parameter, here we take it as no_resp. */ static int imx8_scu_call(struct udevice *dev, int no_resp, void *tx_msg, int tx_size, void *rx_msg, int rx_size)
{ struct imx8_scu *plat = dev_get_platdata(dev); sc_err_t result; int ret; if (rx_msg && tx_msg != rx_msg) printf("tx_msg %p, rx_msg %p\n", tx_msg, rx_msg); ret = sc_ipc_write(plat->base, tx_msg); if (ret) return ret; if (!no_resp) { ret = sc_ipc_read(plat->base, rx_msg); if (ret) return ret; } result = RPC_R8((struct sc_rpc_msg_s *)tx_msg); return sc_err_to_linux(result); }
4ms/stm32mp1-baremetal
C++
Other
137
/* Get sensor hardware device ID. This routine returns device-specific sensor hardware identification and, optionally, version values. Unimplemented values will be set to zero. For example, devices supporting a dedicated ID register, but not a version register, will set "id" to the ID value and "ver" to zero. */
bool sensor_device_id(sensor_t *sensor, uint32_t *id, uint8_t *ver)
/* Get sensor hardware device ID. This routine returns device-specific sensor hardware identification and, optionally, version values. Unimplemented values will be set to zero. For example, devices supporting a dedicated ID register, but not a version register, will set "id" to the ID value and "ver" to zero. */ bool sensor_device_id(sensor_t *sensor, uint32_t *id, uint8_t *ver)
{ sensor_data_t dev_data; bool status = false; status = sensor_read(sensor, SENSOR_READ_ID, &dev_data); if (status) { *id = dev_data.device.id; *ver = (uint8_t)dev_data.device.version; } return status; }
memfault/zero-to-main
C++
null
200
/* This function will return the reason(s) for a reset. Since the reset reasons are sticky until either cleared by software or an external reset, multiple reset reasons may be returned if multiple resets have occurred. The reset reason will be a logical OR of */
unsigned long SysCtlResetCauseGet(void)
/* This function will return the reason(s) for a reset. Since the reset reasons are sticky until either cleared by software or an external reset, multiple reset reasons may be returned if multiple resets have occurred. The reset reason will be a logical OR of */ unsigned long SysCtlResetCauseGet(void)
{ return(HWREG(SYSCTL_RESC)); }
watterott/WebRadio
C++
null
71
/* Enables the selected timer interrupt. ui32Interrupt should be the logical OR of one or more of the following values: */
void am_hal_ctimer_int_enable(uint32_t ui32Interrupt)
/* Enables the selected timer interrupt. ui32Interrupt should be the logical OR of one or more of the following values: */ void am_hal_ctimer_int_enable(uint32_t ui32Interrupt)
{ AM_CRITICAL_BEGIN_ASM AM_REGn(CTIMER, 0, INTEN) |= ui32Interrupt; AM_CRITICAL_END_ASM }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* DAC Channel Disable. Disable a digital to analog converter channel. */
void dac_disable(uint32_t dac, int channel)
/* DAC Channel Disable. Disable a digital to analog converter channel. */ void dac_disable(uint32_t dac, int channel)
{ switch (channel) { case DAC_CHANNEL1: DAC_CR(dac) &= ~DAC_CR_EN1; break; case DAC_CHANNEL2: DAC_CR(dac) &= ~DAC_CR_EN2; break; case DAC_CHANNEL_BOTH: DAC_CR(dac) &= ~(DAC_CR_EN1 | DAC_CR_EN2); break; default: break; } }
libopencm3/libopencm3
C++
GNU General Public License v3.0
2,931
/* Enables or disables the APB1 peripheral clock during Low Power (SLEEP) mode. */
void RCC_APB1PeriphClockLPModeCmd(uint32_t RCC_APB1Periph, FunctionalState NewState)
/* Enables or disables the APB1 peripheral clock during Low Power (SLEEP) mode. */ void RCC_APB1PeriphClockLPModeCmd(uint32_t RCC_APB1Periph, FunctionalState NewState)
{ assert_param(IS_RCC_APB1_PERIPH(RCC_APB1Periph)); assert_param(IS_FUNCTIONAL_STATE(NewState)); if (NewState != DISABLE) { RCC->APB1LPENR |= RCC_APB1Periph; } else { RCC->APB1LPENR &= ~RCC_APB1Periph; } }
apopple/Pandaboard-FreeRTOS
C++
null
25
/* Returns the current speed of the USB controller in device mode. */
uint32_t USBDevSpeedGet(uint32_t ui32Base)
/* Returns the current speed of the USB controller in device mode. */ uint32_t USBDevSpeedGet(uint32_t ui32Base)
{ ASSERT(ui32Base == USB0_BASE); if(HWREGB(ui32Base + USB_O_POWER) & USB_POWER_HSMODE) { return(USB_HIGH_SPEED); } return(USB_FULL_SPEED); }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Get the current statistics. This may be called with the card open or closed. */
static struct net_device_stats * e100_get_stats(struct net_device *dev)
/* Get the current statistics. This may be called with the card open or closed. */ static struct net_device_stats * e100_get_stats(struct net_device *dev)
{ struct net_local *lp = netdev_priv(dev); unsigned long flags; spin_lock_irqsave(&lp->lock, flags); update_rx_stats(&lp->stats); update_tx_stats(&lp->stats); spin_unlock_irqrestore(&lp->lock, flags); return &lp->stats; }
robutest/uclinux
C++
GPL-2.0
60
/* Writes data to the specified GPIO data port. */
void GPIO_Write(GPIO_TypeDef *GPIOx, uint8_t GPIO_PortVal)
/* Writes data to the specified GPIO data port. */ void GPIO_Write(GPIO_TypeDef *GPIOx, uint8_t GPIO_PortVal)
{ GPIOx->ODR = GPIO_PortVal; }
remotemcu/remcu-chip-sdks
C++
null
436
/* Initialize the menu bar with the specified items. */
EFI_STATUS MenuBarInit(IN CONST EDITOR_MENU_ITEM *Items)
/* Initialize the menu bar with the specified items. */ EFI_STATUS MenuBarInit(IN CONST EDITOR_MENU_ITEM *Items)
{ CONST EDITOR_MENU_ITEM *ItemsWalker; for (NumItems = 0, ItemsWalker = Items; ItemsWalker != NULL && ItemsWalker->Function != NULL; ItemsWalker++, NumItems++) { } MenuItems = AllocateZeroPool ((NumItems+1) * sizeof (EDITOR_MENU_ITEM)); if (MenuItems == NULL) { return EFI_OUT_OF_RESOURCES; } CopyMem (MenuItems, Items, (NumItems+1) * sizeof (EDITOR_MENU_ITEM)); return EFI_SUCCESS; }
tianocore/edk2
C++
Other
4,240
/* memory_less_nodes - allocate and initialize CPU only nodes pernode information. */
static void __init memory_less_nodes(void)
/* memory_less_nodes - allocate and initialize CPU only nodes pernode information. */ static void __init memory_less_nodes(void)
{ unsigned long pernodesize; void *pernode; int node; for_each_node_mask(node, memory_less_mask) { pernodesize = compute_pernodesize(node); pernode = memory_less_node_alloc(node, pernodesize); fill_pernode(node, __pa(pernode), pernodesize); } return; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Sets the wake-up sources when in backup mode. */
void SUPC_SetWakeUpSources(unsigned int sources)
/* Sets the wake-up sources when in backup mode. */ void SUPC_SetWakeUpSources(unsigned int sources)
{ SANITY_CHECK((sources & ~0x0000000B) == 0); AT91C_BASE_SUPC->SUPC_WUMR &= ~0x0000000B; AT91C_BASE_SUPC->SUPC_WUMR |= sources; }
apopple/Pandaboard-FreeRTOS
C++
null
25
/* The 64-bit jiffies value is not atomic - you MUST NOT read it without sampling the sequence number in xtime_lock. jiffies is defined in the linker script... */
void do_timer(unsigned long ticks)
/* The 64-bit jiffies value is not atomic - you MUST NOT read it without sampling the sequence number in xtime_lock. jiffies is defined in the linker script... */ void do_timer(unsigned long ticks)
{ jiffies_64 += ticks; update_wall_time(); calc_global_load(); }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Part of this file is ported from coreboot src/arch/x86/boot/pirq_routing.c */
static u8 pirq_get_next_free_irq(struct udevice *dev, u8 *pirq, u16 bitmap, bool irq_already_routed[])
/* Part of this file is ported from coreboot src/arch/x86/boot/pirq_routing.c */ static u8 pirq_get_next_free_irq(struct udevice *dev, u8 *pirq, u16 bitmap, bool irq_already_routed[])
{ int i, link; u8 irq = 0; for (i = 3; i < 16; i++) { if (!((bitmap >> i) & 1)) continue; irq = i; if (irq_already_routed[irq]) continue; for (link = 0; link < CONFIG_MAX_PIRQ_LINKS; link++) { if (pirq_check_irq_routed(dev, link, irq)) { irq_already_routed[irq] = true; break; } } if (!irq_already_routed[irq]) { irq_already_routed[irq] = true; break; } } return irq; }
4ms/stm32mp1-baremetal
C++
Other
137
/* Flush the line discipline queue (if any) for this tty. If there is no line discipline active this is a no-op. */
void tty_ldisc_flush(struct tty_struct *tty)
/* Flush the line discipline queue (if any) for this tty. If there is no line discipline active this is a no-op. */ void tty_ldisc_flush(struct tty_struct *tty)
{ struct tty_ldisc *ld = tty_ldisc_ref(tty); if (ld) { if (ld->ops->flush_buffer) ld->ops->flush_buffer(tty); tty_ldisc_deref(ld); } tty_buffer_flush(tty); }
robutest/uclinux
C++
GPL-2.0
60
/* Internal function to read the current tick counter of local APIC. */
INT32 EFIAPI InternalX86GetTimerTick(IN UINTN ApicBase)
/* Internal function to read the current tick counter of local APIC. */ INT32 EFIAPI InternalX86GetTimerTick(IN UINTN ApicBase)
{ return MmioRead32 (ApicBase + APIC_TMCCT); }
tianocore/edk2
C++
Other
4,240
/* This function is called on interrupt after duty set. */
void pwm_ready_tick(nrf_timer_event_t event_type, void *p_context)
/* This function is called on interrupt after duty set. */ void pwm_ready_tick(nrf_timer_event_t event_type, void *p_context)
{ uint32_t timer_instance_id = (uint32_t)p_context; uint8_t disable = 1; for (uint8_t channel = 0; channel < APP_PWM_CHANNELS_PER_INSTANCE; ++channel) { if (m_pwm_ready_counter[timer_instance_id][channel]) { --m_pwm_ready_counter[timer_instance_id][channel]; if (!m_pwm_ready_counter[timer_instance_id][channel]) { app_pwm_cb_t * p_cb = m_instances[timer_instance_id]->p_cb; p_cb->p_ready_callback(timer_instance_id); } else { disable = 0; } } } if (disable) { pwm_irq_disable(m_instances[timer_instance_id]); } }
labapart/polymcu
C++
null
201
/* Releasing a block device means we sync() it, so that it can safely be forgotten about... */
static irqreturn_t hd_interrupt(int irq, void *dev_id)
/* Releasing a block device means we sync() it, so that it can safely be forgotten about... */ static irqreturn_t hd_interrupt(int irq, void *dev_id)
{ void (*handler)(void) = do_hd; spin_lock(hd_queue->queue_lock); do_hd = NULL; del_timer(&device_timer); if (!handler) handler = unexpected_hd_interrupt; handler(); spin_unlock(hd_queue->queue_lock); return IRQ_HANDLED; }
robutest/uclinux
C++
GPL-2.0
60
/* Disable interrupts and begin the xHCI halting process. */
void xhci_quiesce(struct xhci_hcd *xhci)
/* Disable interrupts and begin the xHCI halting process. */ void xhci_quiesce(struct xhci_hcd *xhci)
{ u32 halted; u32 cmd; u32 mask; mask = ~(XHCI_IRQS); halted = xhci_readl(xhci, &xhci->op_regs->status) & STS_HALT; if (!halted) mask &= ~CMD_RUN; cmd = xhci_readl(xhci, &xhci->op_regs->command); cmd &= mask; xhci_writel(xhci, cmd, &xhci->op_regs->command); }
robutest/uclinux
C++
GPL-2.0
60
/* If HmacSha256Context is NULL, then return FALSE. If NewHmacSha256Context is NULL, then return FALSE. If this interface is not supported, then return FALSE. */
BOOLEAN EFIAPI CryptoServiceHmacSha256Duplicate(IN CONST VOID *HmacSha256Context, OUT VOID *NewHmacSha256Context)
/* If HmacSha256Context is NULL, then return FALSE. If NewHmacSha256Context is NULL, then return FALSE. If this interface is not supported, then return FALSE. */ BOOLEAN EFIAPI CryptoServiceHmacSha256Duplicate(IN CONST VOID *HmacSha256Context, OUT VOID *NewHmacSha256Context)
{ return CALL_BASECRYPTLIB (HmacSha256.Services.Duplicate, HmacSha256Duplicate, (HmacSha256Context, NewHmacSha256Context), FALSE); }
tianocore/edk2
C++
Other
4,240
/* DCMI MSP De-Initialization This function freeze the hardware resources used in this example. */
void HAL_DCMI_MspDeInit(DCMI_HandleTypeDef *hdcmi)
/* DCMI MSP De-Initialization This function freeze the hardware resources used in this example. */ void HAL_DCMI_MspDeInit(DCMI_HandleTypeDef *hdcmi)
{ if(hdcmi->Instance==DCMI) { __HAL_RCC_DCMI_CLK_DISABLE(); HAL_GPIO_DeInit(GPIOH, GPIO_PIN_10|GPIO_PIN_11|GPIO_PIN_14|GPIO_PIN_8 |GPIO_PIN_9|GPIO_PIN_12); HAL_GPIO_DeInit(GPIOE, GPIO_PIN_6); HAL_GPIO_DeInit(GPIOB, GPIO_PIN_7|GPIO_PIN_8); HAL_GPIO_DeInit(GPIOI, GPIO_PIN_4); HAL_GPIO_DeInit(GPIOA, GPIO_PIN_6); HAL_DMA_DeInit(hdcmi->DMA_Handle); } }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* No need to unregister as family unregistration will do it. */
int nl802154_mac_register(void)
/* No need to unregister as family unregistration will do it. */ int nl802154_mac_register(void)
{ int i; int rc; rc = genl_register_mc_group(&nl802154_family, &ieee802154_coord_mcgrp); if (rc) return rc; rc = genl_register_mc_group(&nl802154_family, &ieee802154_beacon_mcgrp); if (rc) return rc; for (i = 0; i < ARRAY_SIZE(ieee802154_coordinator_ops); i++) { rc = genl_register_ops(&nl802154_family, &ieee802154_coordinator_ops[i]); if (rc) return rc; } return 0; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* If the allocation of the new buffer is successful and the smaller of NewSize and OldSize is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT(). */
VOID* EFIAPI ReallocateRuntimePool(IN UINTN OldSize, IN UINTN NewSize, IN VOID *OldBuffer OPTIONAL)
/* If the allocation of the new buffer is successful and the smaller of NewSize and OldSize is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT(). */ VOID* EFIAPI ReallocateRuntimePool(IN UINTN OldSize, IN UINTN NewSize, IN VOID *OldBuffer OPTIONAL)
{ VOID *Buffer; Buffer = InternalReallocatePool (EfiRuntimeServicesData, OldSize, NewSize, OldBuffer); if (Buffer != NULL) { MemoryProfileLibRecord ( (PHYSICAL_ADDRESS)(UINTN)RETURN_ADDRESS (0), MEMORY_PROFILE_ACTION_LIB_REALLOCATE_RUNTIME_POOL, EfiRuntimeServicesData, Buffer, NewSize, NULL ); } return Buffer; }
tianocore/edk2
C++
Other
4,240
/* User processing time, it is recommended to avoid blocking task for long time. */
void USBPD_DPM_UserExecute(void const *argument)
/* User processing time, it is recommended to avoid blocking task for long time. */ void USBPD_DPM_UserExecute(void const *argument)
{ uint32_t _timing = osWaitForever; osMessageQId queue = *(osMessageQId *)argument; do{ osEvent event = osMessageGet(queue, _timing); switch (((DPM_USER_EVENT)event.value.v & 0xF)) { case DPM_USER_EVENT_TIMER: break; default: break; } _timing = CheckDPMTimers(); } while(1); }
st-one/X-CUBE-USB-PD
C++
null
110
/* Check whether there are data in Transmit Holding Register or Transmit Shift Register in SPI master mode. */
uint32_t usart_spi_is_tx_empty(Usart *p_usart)
/* Check whether there are data in Transmit Holding Register or Transmit Shift Register in SPI master mode. */ uint32_t usart_spi_is_tx_empty(Usart *p_usart)
{ return usart_is_tx_empty(p_usart); }
memfault/zero-to-main
C++
null
200
/* Allocate a MTFTP block range, then init it to the range of . */
MTFTP6_BLOCK_RANGE* Mtftp6AllocateRange(IN UINT16 Start, IN UINT16 End)
/* Allocate a MTFTP block range, then init it to the range of . */ MTFTP6_BLOCK_RANGE* Mtftp6AllocateRange(IN UINT16 Start, IN UINT16 End)
{ MTFTP6_BLOCK_RANGE *Range; Range = AllocateZeroPool (sizeof (MTFTP6_BLOCK_RANGE)); if (Range == NULL) { return NULL; } InitializeListHead (&Range->Link); Range->Start = Start; Range->End = End; Range->Bound = End; return Range; }
tianocore/edk2
C++
Other
4,240
/* Convert a byte index (in an UTF-8 text) to character index. E.g. in "AÁRT" index of 'R' is 2th char but start at byte 3 because 'Á' is 2 bytes long */
static uint32_t lv_text_utf8_get_char_id(const char *txt, uint32_t byte_id)
/* Convert a byte index (in an UTF-8 text) to character index. E.g. in "AÁRT" index of 'R' is 2th char but start at byte 3 because 'Á' is 2 bytes long */ static uint32_t lv_text_utf8_get_char_id(const char *txt, uint32_t byte_id)
{ uint32_t i = 0; uint32_t char_cnt = 0; while(i < byte_id) { _lv_text_encoded_next(txt, &i); char_cnt++; } return char_cnt; }
arendst/Tasmota
C++
GNU General Public License v3.0
21,318
/* DMAMUX Reset Request Generator Channel. Reset Request Generator Channel Configuration and interrupt flags. */
void dmamux_reset_request_generator_channel(uint32_t dmamux, uint8_t rg_channel)
/* DMAMUX Reset Request Generator Channel. Reset Request Generator Channel Configuration and interrupt flags. */ void dmamux_reset_request_generator_channel(uint32_t dmamux, uint8_t rg_channel)
{ DMAMUX_RGxCR(dmamux, rg_channel) = 0; dmamux_clear_request_generator_trigger_overrun_interrupt(dmamux, rg_channel); }
libopencm3/libopencm3
C++
GNU General Public License v3.0
2,931
/* Acquires semaphore then writes the data to the PHY register at the offset using the kumeran interface. Release the acquired semaphore before exiting. */
s32 e1000e_write_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 data)
/* Acquires semaphore then writes the data to the PHY register at the offset using the kumeran interface. Release the acquired semaphore before exiting. */ s32 e1000e_write_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 data)
{ return __e1000_write_kmrn_reg(hw, offset, data, false); }
robutest/uclinux
C++
GPL-2.0
60
/* This is the Redfish version of CRT vsnprintf function, this function replaces "%s" to "%a" before invoking AsciiVSPrint(). That is because "%s" is unicode base on edk2 environment however "%s" is ascii code base on vsnprintf(). See definitions of AsciiVSPrint() for the details. */
UINTN EFIAPI RedfishAsciiVSPrint(OUT CHAR8 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR8 *FormatString, IN VA_LIST Marker)
/* This is the Redfish version of CRT vsnprintf function, this function replaces "%s" to "%a" before invoking AsciiVSPrint(). That is because "%s" is unicode base on edk2 environment however "%s" is ascii code base on vsnprintf(). See definitions of AsciiVSPrint() for the details. */ UINTN EFIAPI RedfishAsciiVSPrint(OUT CHAR8 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR8 *FormatString, IN VA_LIST Marker)
{ CHAR8 *TempFormatBuffer; UINTN LenStrProduced; TempFormatBuffer = ReplaceUnicodeToAsciiStrFormat (FormatString); if (TempFormatBuffer == NULL) { return 0; } LenStrProduced = AsciiVSPrint (StartOfBuffer, BufferSize, (CONST CHAR8 *)TempFormatBuffer, Marker); FreePool (TempFormatBuffer); return LenStrProduced; }
tianocore/edk2
C++
Other
4,240
/* Clears or safeguards the OCREF3 signal on an external event. */
void TIM_ClearOC3Ref(TIM_TypeDef *TIMx, uint16_t TIM_OCClear)
/* Clears or safeguards the OCREF3 signal on an external event. */ void TIM_ClearOC3Ref(TIM_TypeDef *TIMx, uint16_t TIM_OCClear)
{ uint16_t tmpccmr2 = 0; assert_param(IS_TIM_LIST3_PERIPH(TIMx)); assert_param(IS_TIM_OCCLEAR_STATE(TIM_OCClear)); tmpccmr2 = TIMx->CCMR2; tmpccmr2 &= (uint16_t)~((uint16_t)TIM_CCMR2_OC3CE); tmpccmr2 |= TIM_OCClear; TIMx->CCMR2 = tmpccmr2; }
gcallipo/RadioDSP-Stm32f103
C++
Common Creative - Attribution 3.0
51
/* Initializes a timer operating in basic capture mode. */
void HRTIM_SimpleCapture_Init(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, HRTIM_BaseInitTypeDef *HRTIM_BaseInitStruct)
/* Initializes a timer operating in basic capture mode. */ void HRTIM_SimpleCapture_Init(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, HRTIM_BaseInitTypeDef *HRTIM_BaseInitStruct)
{ assert_param(IS_HRTIM_TIMERINDEX(TimerIdx)); assert_param(IS_HRTIM_MODE(HRTIM_BaseInitStruct->Mode)); HRTIM_TimingUnitBase_Config(HRTIMx, TimerIdx, HRTIM_BaseInitStruct); }
remotemcu/remcu-chip-sdks
C++
null
436
/* Notify all object if a style is modified */
void lv_obj_report_style_mod(lv_style_t *style)
/* Notify all object if a style is modified */ void lv_obj_report_style_mod(lv_style_t *style)
{ lv_obj_t * i; LL_READ(scr_ll, i) { report_style_mod_core(style, i); } }
RavenSystem/esp-homekit-devices
C++
Other
2,577
/* Return value: Number of bytes the driver will need to DMA map at the same time in order to perform well. */
static unsigned long ibmvfc_get_desired_dma(struct vio_dev *vdev)
/* Return value: Number of bytes the driver will need to DMA map at the same time in order to perform well. */ static unsigned long ibmvfc_get_desired_dma(struct vio_dev *vdev)
{ unsigned long pool_dma = max_requests * sizeof(union ibmvfc_iu); return pool_dma + ((512 * 1024) * driver_template.cmd_per_lun); }
robutest/uclinux
C++
GPL-2.0
60
/* SPDIF clock configuration. Use the default setting as follow: CDCDR(PLL3)->CDCDR(div2)->CDCDR(div8)-> spdif0_clk_root, so the freqency of spdif0_clk should be 480/2/8 = 30MHz. */
void spdif_clk_cfg(void)
/* SPDIF clock configuration. Use the default setting as follow: CDCDR(PLL3)->CDCDR(div2)->CDCDR(div8)-> spdif0_clk_root, so the freqency of spdif0_clk should be 480/2/8 = 30MHz. */ void spdif_clk_cfg(void)
{ HW_CCM_CDCDR.B.SPDIF0_CLK_SEL = 3; HW_CCM_CDCDR.B.SPDIF0_CLK_PODF = 7; HW_CCM_CDCDR.B.SPDIF0_CLK_PRED = 1; clock_gating_config(SPDIF_BASE_ADDR, CLOCK_ON); return; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Get the number of ticks (in CONFIG_SYS_HZ resolution) */
unsigned long long get_ticks(void)
/* Get the number of ticks (in CONFIG_SYS_HZ resolution) */ unsigned long long get_ticks(void)
{ const unsigned long now = read_timer(); if (now >= timer.last_update) timer.ticks += now - timer.last_update; else timer.ticks += TIMER_MAX_VAL - timer.last_update + now; timer.last_update = now; return clk_to_systicks(timer.ticks); }
EmcraftSystems/u-boot
C++
Other
181
/* Retrieves the size, in bytes, of the context buffer required for SHA-384 hash operations. */
UINTN EFIAPI Sha384GetContextSize(VOID)
/* Retrieves the size, in bytes, of the context buffer required for SHA-384 hash operations. */ UINTN EFIAPI Sha384GetContextSize(VOID)
{ CALL_CRYPTO_SERVICE (Sha384GetContextSize, (), 0); }
tianocore/edk2
C++
Other
4,240
/* SYSCTRL DALI Bus&Function Clock Enable and Reset Release. */
void LL_SYSCTRL_DALI_ClkEnRstRelease(void)
/* SYSCTRL DALI Bus&Function Clock Enable and Reset Release. */ void LL_SYSCTRL_DALI_ClkEnRstRelease(void)
{ __LL_SYSCTRL_CTRLReg_Unlock(SYSCTRL); __LL_SYSCTRL_DALIBusClk_En(SYSCTRL); __LL_SYSCTRL_DALISoftRst_Release(SYSCTRL); __LL_SYSCTRL_Reg_Lock(SYSCTRL); }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Configures the analog watchdog 2 guarded single channel. */
void ADC_AnalogWatchdog2SingleChannelConfig(ADC_TypeDef *ADCx, uint8_t ADC_Channel)
/* Configures the analog watchdog 2 guarded single channel. */ void ADC_AnalogWatchdog2SingleChannelConfig(ADC_TypeDef *ADCx, uint8_t ADC_Channel)
{ uint32_t tmpreg = 0; assert_param(IS_ADC_ALL_PERIPH(ADCx)); assert_param(IS_ADC_CHANNEL(ADC_Channel)); tmpreg = ADCx->AWD2CR; tmpreg &= ~(uint32_t)ADC_AWD2CR_AWD2CH; tmpreg |= (uint32_t)1 << (ADC_Channel); ADCx->AWD2CR |= tmpreg; }
ajhc/demo-cortex-m3
C++
null
38
/* Returns: the number of bytes which would be produced if the buffer was large enough. */
gint g_vsnprintf(gchar *string, gulong n, gchar const *format, va_list args)
/* Returns: the number of bytes which would be produced if the buffer was large enough. */ gint g_vsnprintf(gchar *string, gulong n, gchar const *format, va_list args)
{ g_return_val_if_fail (n == 0 || string != NULL, -1); g_return_val_if_fail (format != NULL, -1); return _g_vsnprintf (string, n, format, args); }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* This function returns %0 on success and a negative error code on failure. */
static int read_ltab(struct ubifs_info *c)
/* This function returns %0 on success and a negative error code on failure. */ static int read_ltab(struct ubifs_info *c)
{ int err; void *buf; buf = vmalloc(c->ltab_sz); if (!buf) return -ENOMEM; err = ubifs_leb_read(c, c->ltab_lnum, buf, c->ltab_offs, c->ltab_sz, 1); if (err) goto out; err = unpack_ltab(c, buf); out: vfree(buf); return err; }
4ms/stm32mp1-baremetal
C++
Other
137
/* Set GPOUT to the state specified (1, 0). Returns 0 on success, -EINVAL otherwise. */
s32 stm32f2_gpout_set(const struct stm32f2_gpio_dsc *dsc, int state)
/* Set GPOUT to the state specified (1, 0). Returns 0 on success, -EINVAL otherwise. */ s32 stm32f2_gpout_set(const struct stm32f2_gpio_dsc *dsc, int state)
{ volatile struct stm32f2_gpio_regs *gpio_regs; s32 rv; if (!dsc || dsc->port >= ARRAY_SIZE(io_base) || dsc->pin > 15) { if (gd->have_console) { printf("%s: incorrect params %d.%d.\n", __func__, dsc ? dsc->port : -1, dsc ? dsc->pin : -1); } rv = -EINVAL; goto out; } gpio_regs = (struct stm32f2_gpio_regs *)io_base[dsc->port]; if (state) { gpio_regs->bsrr = 1 << dsc->pin; } else { gpio_regs->bsrr = 1 << (dsc->pin + 16); } rv = 0; out: return rv; }
EmcraftSystems/u-boot
C++
Other
181
/* sunxi_lcd_backlight_disable - disable the backlight of panel. @screen_id: The index of screen. */
void sunxi_lcd_backlight_disable(u32 screen_id)
/* sunxi_lcd_backlight_disable - disable the backlight of panel. @screen_id: The index of screen. */ void sunxi_lcd_backlight_disable(u32 screen_id)
{ if (g_lcd_drv.src_ops.sunxi_lcd_backlight_disable) g_lcd_drv.src_ops.sunxi_lcd_backlight_disable(screen_id); }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Insert an fd_head into the fragment table, and return the key used. */
static gpointer insert_fd_head(reassembly_table *table, fragment_head *fd_head, const packet_info *pinfo, const guint32 id, const void *data)
/* Insert an fd_head into the fragment table, and return the key used. */ static gpointer insert_fd_head(reassembly_table *table, fragment_head *fd_head, const packet_info *pinfo, const guint32 id, const void *data)
{ gpointer key; key = table->persistent_key_func(pinfo, id, data); g_hash_table_insert(table->fragment_table, key, fd_head); return key; }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* s e t u p A l l L o w e r */
returnValue Constraints_setupAllLower(Constraints *_THIS)
/* s e t u p A l l L o w e r */ returnValue Constraints_setupAllLower(Constraints *_THIS)
{ return Constraints_setupAll( _THIS,ST_LOWER ); }
DanielMartensson/EmbeddedLapack
C++
MIT License
129
/* param handle The RTOS SPI handle. param transfer Structure specifying the transfer parameters. return status of the operation. */
status_t SPI_RTOS_Transfer(spi_rtos_handle_t *handle, spi_transfer_t *transfer)
/* param handle The RTOS SPI handle. param transfer Structure specifying the transfer parameters. return status of the operation. */ status_t SPI_RTOS_Transfer(spi_rtos_handle_t *handle, spi_transfer_t *transfer)
{ status_t status; if (xSemaphoreTake(handle->mutex, portMAX_DELAY) != pdTRUE) { return kStatus_SPI_Busy; } status = SPI_MasterTransferNonBlocking(handle->base, &handle->drv_handle, transfer); if (status != kStatus_Success) { (void)xSemaphoreGive(handle->mutex); return status; } if (xSemaphoreTake(handle->event, portMAX_DELAY) != pdTRUE) { return kStatus_SPI_Error; } status = handle->async_status; (void)xSemaphoreGive(handle->mutex); if (status == kStatus_SPI_Idle) { status = kStatus_Success; } return status; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Set the n-th directory as the current directory. NB: Directories are numbered starting at 0. */
int TIFFSetDirectory(TIFF *tif, uint16 dirn)
/* Set the n-th directory as the current directory. NB: Directories are numbered starting at 0. */ int TIFFSetDirectory(TIFF *tif, uint16 dirn)
{ uint64 nextdir; uint16 n; if (!(tif->tif_flags&TIFF_BIGTIFF)) nextdir = tif->tif_header.classic.tiff_diroff; else nextdir = tif->tif_header.big.tiff_diroff; for (n = dirn; n > 0 && nextdir != 0; n--) if (!TIFFAdvanceDirectory(tif, &nextdir, NULL)) return (0); tif->tif_nextdiroff = nextdir; tif->tif_curdir = (dirn - n) - 1; tif->tif_dirnumber = 0; return (TIFFReadDirectory(tif)); }
alibaba/AliOS-Things
C++
Apache License 2.0
4,536
/* Set the baud rate. This routine set the given baud rate for the UART. */
static void baudrate_set(const struct device *dev, uint32_t baudrate, uint32_t sys_clk_freq_hz)
/* Set the baud rate. This routine set the given baud rate for the UART. */ static void baudrate_set(const struct device *dev, uint32_t baudrate, uint32_t sys_clk_freq_hz)
{ const struct uart_stellaris_config *config = dev->config; uint32_t brdi, brdf, div, rem; div = (baudrate * 16U); rem = sys_clk_freq_hz % div; brdf = ((((rem * 64U) << 1) / div) + 1) >> 1; brdi = sys_clk_freq_hz / div; config->uart->ibrd = (uint16_t)(brdi & 0xffff); config->uart->fbrd = (uint8_t)(brdf & 0x3f); }
zephyrproject-rtos/zephyr
C++
Apache License 2.0
9,573
/* param base I2C base pointer. param handle pointer to i2c_master_handle_t structure to store the transfer state. param callback pointer to user callback function. param userData user parameter passed to the callback function. */
void I2C_MasterTransferCreateHandle(I2C_Type *base, i2c_master_handle_t *handle, i2c_master_transfer_callback_t callback, void *userData)
/* param base I2C base pointer. param handle pointer to i2c_master_handle_t structure to store the transfer state. param callback pointer to user callback function. param userData user parameter passed to the callback function. */ void I2C_MasterTransferCreateHandle(I2C_Type *base, i2c_master_handle_t *handle, i2c_master_transfer_callback_t callback, void *userData)
{ assert(NULL != handle); uint32_t instance = I2C_GetInstance(base); (void)memset(handle, 0, sizeof(*handle)); handle->completionCallback = callback; handle->userData = userData; s_i2cHandle[instance] = handle; s_i2cMasterIsr = I2C_MasterTransferHandleIRQ; (void)EnableIRQ(s_i2cIrqs[instance]); }
ARMmbed/DAPLink
C++
Apache License 2.0
2,140
/* Return TRUE when the Endpoint is in any of the Ranges. */
BOOLEAN IsEndpointInRanges(IN UINT64 Endpoint, IN MTRR_MEMORY_RANGE *Ranges, IN UINTN RangeCount)
/* Return TRUE when the Endpoint is in any of the Ranges. */ BOOLEAN IsEndpointInRanges(IN UINT64 Endpoint, IN MTRR_MEMORY_RANGE *Ranges, IN UINTN RangeCount)
{ UINT32 Index; for (Index = 0; Index < RangeCount; Index++) { if (AddressInRange (Endpoint, Ranges[Index])) { return TRUE; } } return FALSE; }
tianocore/edk2
C++
Other
4,240
/* Copies data currently in flash to the block->data and sets the base address. */
static blt_bool FlashInitBlock(tFlashBlockInfo *block, blt_addr address)
/* Copies data currently in flash to the block->data and sets the base address. */ static blt_bool FlashInitBlock(tFlashBlockInfo *block, blt_addr address)
{ blt_bool result = BLT_TRUE; if ((address % FLASH_WRITE_BLOCK_SIZE) != 0) { result = BLT_FALSE; } if (result == BLT_TRUE) { if (block->base_addr != address) { block->base_addr = address; CpuMemCopy((blt_addr)block->data, address, FLASH_WRITE_BLOCK_SIZE); } } return result; }
feaser/openblt
C++
GNU General Public License v3.0
601
/* This function processes the results of changes in configuration. */
EFI_STATUS UiFrontPageCallbackHandler(IN EFI_HII_HANDLE HiiHandle, IN EFI_BROWSER_ACTION Action, IN EFI_QUESTION_ID QuestionId, IN UINT8 Type, IN EFI_IFR_TYPE_VALUE *Value, OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest)
/* This function processes the results of changes in configuration. */ EFI_STATUS UiFrontPageCallbackHandler(IN EFI_HII_HANDLE HiiHandle, IN EFI_BROWSER_ACTION Action, IN EFI_QUESTION_ID QuestionId, IN UINT8 Type, IN EFI_IFR_TYPE_VALUE *Value, OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest)
{ EFI_STATUS Status; if (UiSupportLibCallbackHandler (HiiHandle, Action, QuestionId, Type, Value, ActionRequest, &Status)) { return Status; } return EFI_UNSUPPORTED; }
tianocore/edk2
C++
Other
4,240
/* Try to boot any labels we have yet to attempt to boot. */
static void boot_unattempted_labels(cmd_tbl_t *cmdtp, struct pxe_menu *cfg)
/* Try to boot any labels we have yet to attempt to boot. */ static void boot_unattempted_labels(cmd_tbl_t *cmdtp, struct pxe_menu *cfg)
{ struct list_head *pos; struct pxe_label *label; list_for_each(pos, &cfg->labels) { label = list_entry(pos, struct pxe_label, list); if (!label->attempted) label_boot(cmdtp, label); } }
4ms/stm32mp1-baremetal
C++
Other
137
/* Clean the specified sound buffer with the 8 bits mediane value. */
static void dsp_clean_buffer(uint16_t *buffer, uint32_t size)
/* Clean the specified sound buffer with the 8 bits mediane value. */ static void dsp_clean_buffer(uint16_t *buffer, uint32_t size)
{ uint32_t i; for (i = 0; i < size; ++i){ buffer[i] = 128; } }
remotemcu/remcu-chip-sdks
C++
null
436
/* Read and write a data element from and to the SPI interface. */
unsigned long SPISingleDataReadWrite(unsigned long ulBase, unsigned long ulWData)
/* Read and write a data element from and to the SPI interface. */ unsigned long SPISingleDataReadWrite(unsigned long ulBase, unsigned long ulWData)
{ unsigned long ulReadTemp; xASSERT(ulBase == SPI0_BASE); while((xHWREG(ulBase + SPI_CNTRL) & SPI_CNTRL_GO_BUSY)) { } xHWREG(ulBase + SPI_TX0) = ulWData; xHWREG(ulBase + SPI_CNTRL) |= SPI_CNTRL_GO_BUSY; while((xHWREG(ulBase + SPI_CNTRL) & SPI_CNTRL_GO_BUSY)) { } ulReadTemp = xHWREG(ulBase + SPI_RX0); return ulReadTemp; }
coocox/cox
C++
Berkeley Software Distribution (BSD)
104
/* Post descriptor on the ring. Prior to posting the descriptor should be filled in accordance with Host/Titan interface specification for a given service (LL, etc.). */
void vxge_hw_ring_rxd_post(struct __vxge_hw_ring *ring, void *rxdh)
/* Post descriptor on the ring. Prior to posting the descriptor should be filled in accordance with Host/Titan interface specification for a given service (LL, etc.). */ void vxge_hw_ring_rxd_post(struct __vxge_hw_ring *ring, void *rxdh)
{ struct vxge_hw_ring_rxd_1 *rxdp = (struct vxge_hw_ring_rxd_1 *)rxdh; struct __vxge_hw_channel *channel; channel = &ring->channel; wmb(); rxdp->control_0 |= VXGE_HW_RING_RXD_LIST_OWN_ADAPTER; vxge_hw_channel_dtr_post(channel, rxdh); if (ring->stats->common_stats.usage_cnt > 0) ring->stats->common_stats.usage_cnt--; }
robutest/uclinux
C++
GPL-2.0
60
/* This routine is called whenever TIPC networking is (re)enabled. All existing publications by this node that have "cluster" or "zone" scope are updated to reflect the node's current network address. (If the node's address is unchanged, the update loop terminates immediately.) */
void tipc_named_reinit(void)
/* This routine is called whenever TIPC networking is (re)enabled. All existing publications by this node that have "cluster" or "zone" scope are updated to reflect the node's current network address. (If the node's address is unchanged, the update loop terminates immediately.) */ void tipc_named_reinit(void)
{ struct publication *publ; write_lock_bh(&tipc_nametbl_lock); list_for_each_entry(publ, &publ_root, local_list) { if (publ->node == tipc_own_addr) break; publ->node = tipc_own_addr; } write_unlock_bh(&tipc_nametbl_lock); }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Completes the Map() operation and releases any corresponding resources. */
EFI_STATUS EFIAPI UfsHcUnmap(IN EDKII_UFS_HOST_CONTROLLER_PROTOCOL *This, IN VOID *Mapping)
/* Completes the Map() operation and releases any corresponding resources. */ EFI_STATUS EFIAPI UfsHcUnmap(IN EDKII_UFS_HOST_CONTROLLER_PROTOCOL *This, IN VOID *Mapping)
{ UFS_HOST_CONTROLLER_PRIVATE_DATA *Private; EFI_PCI_IO_PROTOCOL *PciIo; EFI_STATUS Status; if ((This == NULL) || (Mapping == NULL)) { return EFI_INVALID_PARAMETER; } Private = UFS_HOST_CONTROLLER_PRIVATE_DATA_FROM_UFSHC (This); PciIo = Private->PciIo; Status = PciIo->Unmap (PciIo, Mapping); return Status; }
tianocore/edk2
C++
Other
4,240
/* This routine is called by DDI when the (dynamically assigned) device is registered */
static void strip_dev_setup(struct net_device *dev)
/* This routine is called by DDI when the (dynamically assigned) device is registered */ static void strip_dev_setup(struct net_device *dev)
{ dev->trans_start = 0; dev->tx_queue_len = 30; dev->flags = 0; dev->mtu = DEFAULT_STRIP_MTU; dev->type = ARPHRD_METRICOM; dev->hard_header_len = sizeof(STRIP_Header); *(MetricomAddress *)dev->broadcast = broadcast_address; dev->dev_addr[0] = 0; dev->addr_len = sizeof(MetricomAddress); dev->header_ops = &strip_header_ops, dev->netdev_ops = &strip_netdev_ops; }
robutest/uclinux
C++
GPL-2.0
60
/* This function finds a usb class driver by specified class code and subclass code. */
ucd_t rt_usb_class_driver_find(int class_code, int subclass_code)
/* This function finds a usb class driver by specified class code and subclass code. */ ucd_t rt_usb_class_driver_find(int class_code, int subclass_code)
{ struct rt_list_node *node; if (rt_thread_self() != RT_NULL) rt_enter_critical(); for (node = _driver_list.next; node != &_driver_list; node = node->next) { ucd_t drv = (ucd_t)rt_list_entry(node, struct uclass_driver, list); if (drv->class_code == class_code) { if (rt_thread_self() != RT_NULL) rt_exit_critical(); return drv; } } if (rt_thread_self() != RT_NULL) rt_exit_critical(); return RT_NULL; }
armink/FreeModbus_Slave-Master-RTT-STM32
C++
Other
1,477
/* Return the number of entries in the gExceptionType */
UINTN MaxEfiException(VOID)
/* Return the number of entries in the gExceptionType */ UINTN MaxEfiException(VOID)
{ return sizeof (gExceptionType) / sizeof (EFI_EXCEPTION_TYPE_ENTRY); }
tianocore/edk2
C++
Other
4,240
/* Note that using this function requires that the client's adapter support the I2C_FUNC_SMBUS_READ_BLOCK_DATA functionality. Not all adapter drivers support this; its emulation through I2C messaging relies on a specific mechanism (I2C_M_RECV_LEN) which may not be implemented. */
s32 i2c_smbus_read_block_data(struct i2c_client *client, u8 command, u8 *values)
/* Note that using this function requires that the client's adapter support the I2C_FUNC_SMBUS_READ_BLOCK_DATA functionality. Not all adapter drivers support this; its emulation through I2C messaging relies on a specific mechanism (I2C_M_RECV_LEN) which may not be implemented. */ s32 i2c_smbus_read_block_data(struct i2c_client *client, u8 command, u8 *values)
{ union i2c_smbus_data data; int status; status = i2c_smbus_xfer(client->adapter, client->addr, client->flags, I2C_SMBUS_READ, command, I2C_SMBUS_BLOCK_DATA, &data); if (status) return status; memcpy(values, &data.block[1], data.block[0]); return data.block[0]; }
robutest/uclinux
C++
GPL-2.0
60
/* Sets or Resets the TIM peripheral Capture Compare Preload Control bit. */
void TIM_CCPreloadControl(TIM_TypeDef *TIMx, FunctionalState NewState)
/* Sets or Resets the TIM peripheral Capture Compare Preload Control bit. */ void TIM_CCPreloadControl(TIM_TypeDef *TIMx, FunctionalState NewState)
{ assert_param(IS_TIM_LIST6_PERIPH(TIMx)); assert_param(IS_FUNCTIONAL_STATE(NewState)); if (NewState != DISABLE) { TIMx->CR2 |= TIM_CR2_CCPC; } else { TIMx->CR2 &= (uint16_t)~TIM_CR2_CCPC; } }
ajhc/demo-cortex-m3
C++
null
38
/* Locking: must be called with the lp_mutex held */
void __fc_linkdown(struct fc_lport *lport)
/* Locking: must be called with the lp_mutex held */ void __fc_linkdown(struct fc_lport *lport)
{ if (lport->link_up) { lport->link_up = 0; fc_lport_enter_reset(lport); lport->tt.fcp_cleanup(lport); } }
robutest/uclinux
C++
GPL-2.0
60
/* brief Return Frequency of SystickClock return Frequency of Systick Clock */
static uint32_t CLOCK_GetSystickClkFreq(uint32_t id)
/* brief Return Frequency of SystickClock return Frequency of Systick Clock */ static uint32_t CLOCK_GetSystickClkFreq(uint32_t id)
{ uint32_t freq = 0U; switch ((id == 0U) ? SYSCON->SYSTICKCLKSEL0 : SYSCON->SYSTICKCLKSEL1) { case 0U: freq = CLOCK_GetCoreSysClkFreq() / (((SYSCON->SYSTICKCLKDIV[id]) & 0xffU) + 1U); break; case 1U: freq = CLOCK_GetClk1MFreq(); break; case 2U: freq = CLOCK_GetLposcFreq(); break; default: freq = 0U; break; } return freq; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* This function sets bus clock frequency of USCI_I2C module. */
uint32_t UI2C_SetBusClockFreq(UI2C_T *ui2c, uint32_t u32BusClock)
/* This function sets bus clock frequency of USCI_I2C module. */ uint32_t UI2C_SetBusClockFreq(UI2C_T *ui2c, uint32_t u32BusClock)
{ uint32_t u32ClkDiv; uint32_t u32Pclk; if((ui2c == UI2C1) || (ui2c == UI2C1_NS)) { u32Pclk = CLK_GetPCLK1Freq(); } else { u32Pclk = CLK_GetPCLK0Freq(); } u32ClkDiv = (uint32_t)((((((u32Pclk / 2u) * 10u) / (u32BusClock)) + 5u) / 10u) - 1u); ui2c->BRGEN &= ~UI2C_BRGEN_CLKDIV_Msk; ui2c->BRGEN |= (u32ClkDiv << UI2C_BRGEN_CLKDIV_Pos); return (u32Pclk / ((u32ClkDiv + 1u) << 1u)); }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Perform a "final reduction" in field F255 (field for Curve25519) The source value must be less than twice the modulus. If the value is not lower than the modulus, then the modulus is subtracted and this function returns 1; otherwise, it leaves it untouched and it returns 0. */
static uint32_t reduce_final_f255(uint32_t *d)
/* Perform a "final reduction" in field F255 (field for Curve25519) The source value must be less than twice the modulus. If the value is not lower than the modulus, then the modulus is subtracted and this function returns 1; otherwise, it leaves it untouched and it returns 0. */ static uint32_t reduce_final_f255(uint32_t *d)
{ uint32_t t[9]; uint32_t cc; int i; memcpy(t, d, sizeof t); cc = 19; for (i = 0; i < 9; i ++) { uint32_t w; w = t[i] + cc; cc = w >> 30; t[i] = w & 0x3FFFFFFF; } cc = t[8] >> 15; t[8] &= 0x7FFF; CCOPY(cc, d, t, sizeof t); return cc; }
RavenSystem/esp-homekit-devices
C++
Other
2,577
/* Fix sconfig's bus width according to at_dmac. 1 byte -> 0, 2 bytes -> 1, 4 bytes -> 2, 8bytes -> 3 */
static uint32_t convert_buswidth(enum dma_slave_buswidth addr_width)
/* Fix sconfig's bus width according to at_dmac. 1 byte -> 0, 2 bytes -> 1, 4 bytes -> 2, 8bytes -> 3 */ static uint32_t convert_buswidth(enum dma_slave_buswidth addr_width)
{ if (addr_width > DMA_SLAVE_BUSWIDTH_8_BYTES) { return 0; } switch (addr_width) { case DMA_SLAVE_BUSWIDTH_2_BYTES: return 1; case DMA_SLAVE_BUSWIDTH_4_BYTES: return 2; case DMA_SLAVE_BUSWIDTH_8_BYTES: return 3; default: return 0; } }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Set new plot colors. This sets new draw and background colors for the plot. */
void wtk_plot_set_colors(struct wtk_plot *plot, gfx_color_t draw_color, struct gfx_bitmap *background)
/* Set new plot colors. This sets new draw and background colors for the plot. */ void wtk_plot_set_colors(struct wtk_plot *plot, gfx_color_t draw_color, struct gfx_bitmap *background)
{ Assert(plot); plot->draw_color = draw_color; plot->background = background; }
memfault/zero-to-main
C++
null
200
/* Reads the Target time stamp registers This function Loads the target time stamp registers with the values proviced */
void synopGMAC_TS_read_target_timestamp(synopGMACdevice *gmacdev, u32 *sec_val, u32 *sub_sec_val)
/* Reads the Target time stamp registers This function Loads the target time stamp registers with the values proviced */ void synopGMAC_TS_read_target_timestamp(synopGMACdevice *gmacdev, u32 *sec_val, u32 *sub_sec_val)
{ * sec_val = synopGMACReadReg(gmacdev->MacBase, GmacTSTargetTimeHigh); * sub_sec_val = synopGMACReadReg(gmacdev->MacBase, GmacTSTargetTimeLow); return; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* This routine is called when a Restart Confirmation is needed */
static void x25_transmit_restart_confirmation(struct x25_neigh *nb)
/* This routine is called when a Restart Confirmation is needed */ static void x25_transmit_restart_confirmation(struct x25_neigh *nb)
{ unsigned char *dptr; int len = X25_MAX_L2_LEN + X25_STD_MIN_LEN; struct sk_buff *skb = alloc_skb(len, GFP_ATOMIC); if (!skb) return; skb_reserve(skb, X25_MAX_L2_LEN); dptr = skb_put(skb, X25_STD_MIN_LEN); *dptr++ = nb->extended ? X25_GFI_EXTSEQ : X25_GFI_STDSEQ; *dptr++ = 0x00; *dptr++ = X25_RESTART_CONFIRMATION; skb->sk = NULL; x25_send_frame(skb, nb); }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Flush all the (user) entries for the address space described by mm. */
void flush_tlb_mm(struct mm_struct *mm)
/* Flush all the (user) entries for the address space described by mm. */ void flush_tlb_mm(struct mm_struct *mm)
{ struct vm_area_struct *mp; if (Hash == 0) { _tlbia(); return; } for (mp = mm->mmap; mp != NULL; mp = mp->vm_next) flush_range(mp->vm_mm, mp->vm_start, mp->vm_end); FINISH_FLUSH; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* This function validates the chip ID of device */
static int drv_acc_gyro_bosch_bmi260_validate_id(i2c_dev_t *drv, uint8_t id_value)
/* This function validates the chip ID of device */ static int drv_acc_gyro_bosch_bmi260_validate_id(i2c_dev_t *drv, uint8_t id_value)
{ uint8_t value = 0x00; int ret = 0; if(drv == NULL) { return -1; } ret = sensor_i2c_read(drv, BMI2_CHIP_ID_ADDR, &value, I2C_DATA_LEN, I2C_OP_RETRIES); if(unlikely(ret) != 0) { printf("read CHIPID failed \n"); return ret; } printf("!!!!!!read CHIPID %x\n", value); if(id_value != (value & 0x20)) { printf("!!!!!failed read CHIPID %x\n", value); return -1; } return 0; }
alibaba/AliOS-Things
C++
Apache License 2.0
4,536
/* 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==TIM2) { __HAL_RCC_TIM2_CLK_DISABLE(); } else if(htim_base->Instance==TIM3) { __HAL_RCC_TIM3_CLK_DISABLE(); } else if(htim_base->Instance==TIM4) { __HAL_RCC_TIM4_CLK_DISABLE(); } else if(htim_base->Instance==TIM5) { __HAL_RCC_TIM5_CLK_DISABLE(); } }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Handles a notification that a find-type-value response has been fully processed for the specified discover-service-by-uuid proc. */
static int ble_gattc_disc_svc_uuid_rx_complete(struct ble_gattc_proc *proc, int status)
/* Handles a notification that a find-type-value response has been fully processed for the specified discover-service-by-uuid proc. */ static int ble_gattc_disc_svc_uuid_rx_complete(struct ble_gattc_proc *proc, int status)
{ int rc; ble_gattc_dbg_assert_proc_not_inserted(proc); if (status != 0) { ble_gattc_disc_svc_uuid_cb(proc, status, 0, NULL); return BLE_HS_EDONE; } if (proc->disc_svc_uuid.prev_handle == 0xffff) { ble_gattc_disc_svc_uuid_cb(proc, BLE_HS_EDONE, 0, NULL); return BLE_HS_EDONE; } rc = ble_gattc_disc_svc_uuid_resume(proc); if (rc != 0) { return BLE_HS_EDONE; } return 0; }
Nicholas3388/LuaNode
C++
Other
1,055
/* If an imprecise data rate is too high due to rounding error propagation, compute a suitably rounded mclk_ps to compute a working memory controller configuration. */
unsigned int get_memory_clk_period_ps(void)
/* If an imprecise data rate is too high due to rounding error propagation, compute a suitably rounded mclk_ps to compute a working memory controller configuration. */ unsigned int get_memory_clk_period_ps(void)
{ unsigned int mclk_ps; mclk_ps = 2000000000000ULL / fsl_ddr_get_mem_data_rate(); return 10 * ((mclk_ps + 5) / 10); }
EmcraftSystems/u-boot
C++
Other
181
/* DAC960_ParsePhysicalDevice parses spaces followed by a Physical Device Channel:TargetID specification from a User Command string. It updates Channel and TargetID and returns true on success and false on failure. */
static bool DAC960_ParsePhysicalDevice(DAC960_Controller_T *Controller, char *UserCommandString, unsigned char *Channel, unsigned char *TargetID)
/* DAC960_ParsePhysicalDevice parses spaces followed by a Physical Device Channel:TargetID specification from a User Command string. It updates Channel and TargetID and returns true on success and false on failure. */ static bool DAC960_ParsePhysicalDevice(DAC960_Controller_T *Controller, char *UserCommandString, unsigned char *Channel, unsigned char *TargetID)
{ char *NewUserCommandString = UserCommandString; unsigned long XChannel, XTargetID; while (*UserCommandString == ' ') UserCommandString++; if (UserCommandString == NewUserCommandString) return false; XChannel = simple_strtoul(UserCommandString, &NewUserCommandString, 10); if (NewUserCommandString == UserCommandString || *NewUserCommandString != ':' || XChannel >= Controller->Channels) return false; UserCommandString = ++NewUserCommandString; XTargetID = simple_strtoul(UserCommandString, &NewUserCommandString, 10); if (NewUserCommandString == UserCommandString || *NewUserCommandString != '\0' || XTargetID >= Controller->Targets) return false; *Channel = XChannel; *TargetID = XTargetID; return true; }
robutest/uclinux
C++
GPL-2.0
60
/* Called after closing the device, but before snd_card_saa7134_capture_close It stops the DMA audio and releases the buffers. */
static int snd_card_saa7134_hw_free(struct snd_pcm_substream *substream)
/* Called after closing the device, but before snd_card_saa7134_capture_close It stops the DMA audio and releases the buffers. */ static int snd_card_saa7134_hw_free(struct snd_pcm_substream *substream)
{ snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream); struct saa7134_dev *dev; dev = saa7134->dev; if (substream->runtime->dma_area) { saa7134_pgtable_free(dev->pci, &dev->dmasound.pt); videobuf_sg_dma_unmap(&dev->pci->dev, &dev->dmasound.dma); dsp_buffer_free(dev); substream->runtime->dma_area = NULL; } return 0; }
robutest/uclinux
C++
GPL-2.0
60
/* This function returns the number of orphans that can be written in the available space. */
static int avail_orphs(struct ubifs_info *c)
/* This function returns the number of orphans that can be written in the available space. */ static int avail_orphs(struct ubifs_info *c)
{ int avail_lebs, avail, gap; avail_lebs = c->orph_lebs - (c->ohead_lnum - c->orph_first) - 1; avail = avail_lebs * ((c->leb_size - UBIFS_ORPH_NODE_SZ) / sizeof(__le64)); gap = c->leb_size - c->ohead_offs; if (gap >= UBIFS_ORPH_NODE_SZ + sizeof(__le64)) avail += (gap - UBIFS_ORPH_NODE_SZ) / sizeof(__le64); return avail; }
robutest/uclinux
C++
GPL-2.0
60
/* Set Wake up Interrupt. Sets the wake up bit of an external interrupt. */
void drv_nvic_set_wakeup_irq(int32_t IRQn)
/* Set Wake up Interrupt. Sets the wake up bit of an external interrupt. */ void drv_nvic_set_wakeup_irq(int32_t IRQn)
{ NVIC->IWER[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); }
pikasTech/PikaPython
C++
MIT License
1,403
/* Clear an own-rx-busy condition and tell the peer about this, provided that there is a significant amount of free receive buffer space available. */
void x25_check_rbuf(struct sock *sk)
/* Clear an own-rx-busy condition and tell the peer about this, provided that there is a significant amount of free receive buffer space available. */ void x25_check_rbuf(struct sock *sk)
{ struct x25_sock *x25 = x25_sk(sk); if (atomic_read(&sk->sk_rmem_alloc) < (sk->sk_rcvbuf >> 1) && (x25->condition & X25_COND_OWN_RX_BUSY)) { x25->condition &= ~X25_COND_OWN_RX_BUSY; x25->condition &= ~X25_COND_ACK_PENDING; x25->vl = x25->vr; x25_write_internal(sk, X25_RR); x25_stop_timer(sk); } }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Increases a pointer while it points to a character that belongs to a set. */
static char* goWhile(char *str, char const *set)
/* Increases a pointer while it points to a character that belongs to a set. */ static char* goWhile(char *str, char const *set)
{ for (; *str != '\0'; ++str) { if (!isOneOfThem(*str, set)) return str; } return 0; }
Luos-io/luos_engine
C++
MIT License
496
/* Start the watchdog timer. This timer is used to make sure that any connection attempt is successful, and if not, we will retry after the timeout */
static void ircomm_tty_start_watchdog_timer(struct ircomm_tty_cb *self, int timeout)
/* Start the watchdog timer. This timer is used to make sure that any connection attempt is successful, and if not, we will retry after the timeout */ static void ircomm_tty_start_watchdog_timer(struct ircomm_tty_cb *self, int timeout)
{ IRDA_ASSERT(self != NULL, return;); IRDA_ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;); irda_start_timer(&self->watchdog_timer, timeout, (void *) self, ircomm_tty_watchdog_timer_expired); }
EmcraftSystems/linux-emcraft
C++
Other
266
/* This is basically standard AC97. It should work as a default for almost all modern codecs. Note that some cards wire EAPD */
static int eapd_control(struct ac97_codec *codec, int)
/* This is basically standard AC97. It should work as a default for almost all modern codecs. Note that some cards wire EAPD */ static int eapd_control(struct ac97_codec *codec, int)
{ if(on) codec->codec_write(codec, AC97_POWER_CONTROL, codec->codec_read(codec, AC97_POWER_CONTROL)|0x8000); else codec->codec_write(codec, AC97_POWER_CONTROL, codec->codec_read(codec, AC97_POWER_CONTROL)&~0x8000); return 0; }
robutest/uclinux
C++
GPL-2.0
60
/* Returns 0 if the vec is invalid. It is invalid if the number of bytes causes the address to wrap or overflows an unsigned int. This comes from being stored in the 'length' member of 'struct scatterlist'. */
static unsigned int rds_pages_in_vec(struct rds_iovec *vec)
/* Returns 0 if the vec is invalid. It is invalid if the number of bytes causes the address to wrap or overflows an unsigned int. This comes from being stored in the 'length' member of 'struct scatterlist'. */ static unsigned int rds_pages_in_vec(struct rds_iovec *vec)
{ if ((vec->addr + vec->bytes <= vec->addr) || (vec->bytes > (u64)UINT_MAX)) return 0; return ((vec->addr + vec->bytes + PAGE_SIZE - 1) >> PAGE_SHIFT) - (vec->addr >> PAGE_SHIFT); }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Initialises the appropriate serial bus (UART, etc.),and sets up any buffers or peripherals required by the PN532. */
void pn532Init(void)
/* Initialises the appropriate serial bus (UART, etc.),and sets up any buffers or peripherals required by the PN532. */ void pn532Init(void)
{ memset(&pcb, 0, sizeof(pn532_pcb_t)); pn532_bus_HWInit(); pcb.initialised = TRUE; }
microbuilder/LPC1343CodeBase
C++
Other
73
/* Install a file pte to a given virtual memory address, release any previously existing mapping. */
static int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, unsigned long pgoff, pgprot_t prot)
/* Install a file pte to a given virtual memory address, release any previously existing mapping. */ static int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, unsigned long pgoff, pgprot_t prot)
{ int err = -ENOMEM; pte_t *pte; spinlock_t *ptl; pte = get_locked_pte(mm, addr, &ptl); if (!pte) goto out; if (!pte_none(*pte)) zap_pte(mm, vma, addr, pte); set_pte_at(mm, addr, pte, pgoff_to_pte(pgoff)); pte_unmap_unlock(pte, ptl); err = 0; out: return err; }
robutest/uclinux
C++
GPL-2.0
60
/* If 32-bit I/O port operations are not supported, then ASSERT(). */
UINT32 EFIAPI IoRead32(IN UINTN Port)
/* If 32-bit I/O port operations are not supported, then ASSERT(). */ UINT32 EFIAPI IoRead32(IN UINTN Port)
{ ASSERT ((Port & 3) == 0); return (UINT32)IoReadWorker (Port, EfiCpuIoWidthUint32); }
tianocore/edk2
C++
Other
4,240
/* This callback is called when the error recovery driver tells us that its OK to resume normal operation. */
static void vxge_io_resume(struct pci_dev *pdev)
/* This callback is called when the error recovery driver tells us that its OK to resume normal operation. */ static void vxge_io_resume(struct pci_dev *pdev)
{ struct __vxge_hw_device *hldev = (struct __vxge_hw_device *) pci_get_drvdata(pdev); struct net_device *netdev = hldev->ndev; if (netif_running(netdev)) { if (vxge_open(netdev)) { printk(KERN_ERR "%s: " "Can't bring device back up after reset\n", VXGE_DRIVER_NAME); return; } } netif_device_attach(netdev); }
robutest/uclinux
C++
GPL-2.0
60
/* DMA Stream Set Memory Burst Configuration. Ensure that the stream is disabled otherwise the setting will not be changed. */
void dma_set_memory_burst(uint32_t dma, uint8_t stream, uint32_t burst)
/* DMA Stream Set Memory Burst Configuration. Ensure that the stream is disabled otherwise the setting will not be changed. */ void dma_set_memory_burst(uint32_t dma, uint8_t stream, uint32_t burst)
{ uint32_t reg32 = (DMA_SCR(dma, stream) & ~DMA_SxCR_MBURST_MASK); DMA_SCR(dma, stream) = (reg32 | burst); }
insane-adding-machines/unicore-mx
C++
GNU General Public License v3.0
50
/* RNG MSP De-Initialization This function freeze the hardware resources used in this example. */
void HAL_RNG_MspDeInit(RNG_HandleTypeDef *hrng)
/* RNG MSP De-Initialization This function freeze the hardware resources used in this example. */ void HAL_RNG_MspDeInit(RNG_HandleTypeDef *hrng)
{ __HAL_RCC_RNG_CLK_DISABLE(); } }
prusa3d/Prusa-Firmware-Buddy
C++
Other
1,019
/* Gets the instance from the base address to be used to gate or ungate the module clock. */
static uint32_t MECC_GetInstance(MECC_Type *base)
/* Gets the instance from the base address to be used to gate or ungate the module clock. */ static uint32_t MECC_GetInstance(MECC_Type *base)
{ uint32_t instance; for (instance = 0; instance < ARRAY_SIZE(s_meccBases); instance++) { if (s_meccBases[instance] == base) { break; } } assert(instance < ARRAY_SIZE(s_meccBases)); return instance; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Threshold for wakeup.1 LSB = FS_XL / 64.. */
int32_t lsm6dsl_wkup_threshold_get(stmdev_ctx_t *ctx, uint8_t *val)
/* Threshold for wakeup.1 LSB = FS_XL / 64.. */ int32_t lsm6dsl_wkup_threshold_get(stmdev_ctx_t *ctx, uint8_t *val)
{ lsm6dsl_wake_up_ths_t wake_up_ths; int32_t ret; ret = lsm6dsl_read_reg(ctx, LSM6DSL_WAKE_UP_THS, (uint8_t*)&wake_up_ths, 1); *val = wake_up_ths.wk_ths; return ret; }
eclipse-threadx/getting-started
C++
Other
310
/* Accelerometer slope filter / high-pass filter selection on output.. */
int32_t lsm6dso_xl_hp_path_on_out_set(lsm6dso_ctx_t *ctx, lsm6dso_hp_slope_xl_en_t val)
/* Accelerometer slope filter / high-pass filter selection on output.. */ int32_t lsm6dso_xl_hp_path_on_out_set(lsm6dso_ctx_t *ctx, lsm6dso_hp_slope_xl_en_t val)
{ lsm6dso_ctrl8_xl_t reg; int32_t ret; ret = lsm6dso_read_reg(ctx, LSM6DSO_CTRL8_XL, (uint8_t*)&reg, 1); if (ret == 0) { reg.hp_slope_xl_en = ((uint8_t)val & 0x10U) >> 4; reg.hp_ref_mode_xl = ((uint8_t)val & 0x20U) >> 5; reg.hpcf_xl = (uint8_t)val & 0x07U; ret = lsm6dso_write_reg(ctx, LSM6DSO_CTRL8_XL, (uint8_t*)&reg, 1); } return ret; }
alexander-g-dean/ESF
C++
null
41