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 |
|---|---|---|---|---|---|---|---|
/* Since this function gets called with the 'nextarg' pointer from within the getparameter a lot, we must check it for NULL before accessing the str data. */ | ParameterError str2unum(long *val, const char *str) | /* Since this function gets called with the 'nextarg' pointer from within the getparameter a lot, we must check it for NULL before accessing the str data. */
ParameterError str2unum(long *val, const char *str) | {
ParameterError result = str2num(val, str);
if(result != PARAM_OK)
return result;
if(*val < 0)
return PARAM_NEGATIVE_NUMERIC;
return PARAM_OK;
} | alibaba/AliOS-Things | C++ | Apache License 2.0 | 4,536 |
/* Prevent the memory pages used for SMM page table from been overwritten. */ | VOID EnablePageTableProtection(VOID) | /* Prevent the memory pages used for SMM page table from been overwritten. */
VOID EnablePageTableProtection(VOID) | {
PAGE_TABLE_POOL *HeadPool;
PAGE_TABLE_POOL *Pool;
UINT64 PoolSize;
EFI_PHYSICAL_ADDRESS Address;
UINTN PageTableBase;
if (mPageTablePool == NULL) {
return;
}
PageTableBase = AsmReadCr3 () & PAGING_4K_ADDRESS_MASK_64;
HeadPool = mPageTablePool;
Pool = HeadPool;
do {
Address = (EFI_PHYSICAL_ADDRESS)(UINTN)Pool;
PoolSize = Pool->Offset + EFI_PAGES_TO_SIZE (Pool->FreePages);
ConvertMemoryPageAttributes (PageTableBase, mPagingMode, Address, PoolSize, EFI_MEMORY_RO, TRUE, NULL);
Pool = Pool->NextPool;
} while (Pool != HeadPool);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* This function is similar to 'ubi_get_device()', but it searches the device by its major number. */ | struct ubi_device* ubi_get_by_major(int major) | /* This function is similar to 'ubi_get_device()', but it searches the device by its major number. */
struct ubi_device* ubi_get_by_major(int major) | {
int i;
struct ubi_device *ubi;
spin_lock(&ubi_devices_lock);
for (i = 0; i < UBI_MAX_DEVICES; i++) {
ubi = ubi_devices[i];
if (ubi && MAJOR(ubi->cdev.dev) == major) {
ubi_assert(ubi->ref_count >= 0);
ubi->ref_count += 1;
get_device(&ubi->dev);
spin_unlock(&ubi_devices_lock);
return ubi;
}
}
spin_unlock(&ubi_devices_lock);
return NULL;
} | EmcraftSystems/u-boot | C++ | Other | 181 |
/* Reset the EINT peripheral registers to their default reset values. */ | void EINT_Reset(void) | /* Reset the EINT peripheral registers to their default reset values. */
void EINT_Reset(void) | {
EINT->IMASK = 0x00000000;
EINT->EMASK = 0x00000000;
EINT->RTEN = 0x00000000;
EINT->FTEN = 0x00000000;
EINT->IPEND = 0x007FFFFF;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Search the default environment for a variable. Return the value, if found, or NULL, if not found. */ | char* fw_getdefenv(char *name) | /* Search the default environment for a variable. Return the value, if found, or NULL, if not found. */
char* fw_getdefenv(char *name) | {
char *env, *nxt;
for (env = default_environment; *env; env = nxt + 1) {
char *val;
for (nxt = env; *nxt; ++nxt) {
if (nxt >= &default_environment[ENV_SIZE]) {
fprintf(stderr, "## Error: "
"default environment not terminated\n");
return NULL;
}
}
val = envmatch(name, env);
if (!val)
continue;
return val;
}
return NULL;
} | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* Wait for event, pass it to the hci_event_handler and update the event opcode in a global variable.
SimpleLinkWaitEvent */ | void SimpleLinkWaitEvent(UINT16 usOpcode, void *pRetParams) | /* Wait for event, pass it to the hci_event_handler and update the event opcode in a global variable.
SimpleLinkWaitEvent */
void SimpleLinkWaitEvent(UINT16 usOpcode, void *pRetParams) | {
tSLInformation.usRxEventOpcode = usOpcode;
hci_event_handler(pRetParams, 0, 0);
} | alibaba/AliOS-Things | C++ | Apache License 2.0 | 4,536 |
/* Add a shrinker callback to be called from the vm */ | void register_shrinker(struct shrinker *shrinker) | /* Add a shrinker callback to be called from the vm */
void register_shrinker(struct shrinker *shrinker) | {
shrinker->nr = 0;
down_write(&shrinker_rwsem);
list_add_tail(&shrinker->list, &shrinker_list);
up_write(&shrinker_rwsem);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Check if the given GPNVM bit is set or not. */ | uint32_t flash_is_gpnvm_set(uint32_t ul_gpnvm) | /* Check if the given GPNVM bit is set or not. */
uint32_t flash_is_gpnvm_set(uint32_t ul_gpnvm) | {
uint32_t ul_gpnvm_bits;
if (ul_gpnvm >= GPNVM_NUM_MAX) {
return FLASH_RC_INVALID;
}
if (EFC_RC_OK != efc_perform_command(EFC, EFC_FCMD_GGPB, 0)) {
return FLASH_RC_ERROR;
}
ul_gpnvm_bits = efc_get_result(EFC);
if (ul_gpnvm_bits & (1 << ul_gpnvm)) {
return FLASH_RC_YES;
}
return FLASH_RC_NO;
} | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* Checks whether the PVD interrupt has occurred or not. */ | ITStatus PWR_PVDGetITStatus(void) | /* Checks whether the PVD interrupt has occurred or not. */
ITStatus PWR_PVDGetITStatus(void) | {
ITStatus bitstatus = RESET;
uint8_t PVD_itStatus = 0x0, PVD_itEnable = 0x0;
PVD_itStatus = (uint8_t)(PWR->CSR1 & (uint8_t)PWR_CSR1_PVDIF);
PVD_itEnable = (uint8_t)(PWR->CSR1 & (uint8_t)PWR_CSR1_PVDIEN);
if ((PVD_itStatus != (uint8_t)RESET ) && (PVD_itEnable != (uint8_t)RESET))
{
bitstatus = (ITStatus)SET;
}
else
{
bitstatus = (ITStatus)RESET;
}
return ((ITStatus)bitstatus);
} | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* GEM associated PHY detection and setup function If the current GEM device shall manage an associated PHY, its detection and configuration is performed from within this function. Called from within the device initialization function. This function refers to functionality implemented in the phy_xlnx_gem module. */ | static void eth_xlnx_gem_init_phy(const struct device *dev) | /* GEM associated PHY detection and setup function If the current GEM device shall manage an associated PHY, its detection and configuration is performed from within this function. Called from within the device initialization function. This function refers to functionality implemented in the phy_xlnx_gem module. */
static void eth_xlnx_gem_init_phy(const struct device *dev) | {
struct eth_xlnx_gem_dev_data *dev_data = dev->data;
int detect_rc;
LOG_DBG("%s attempting to initialize associated PHY", dev->name);
detect_rc = phy_xlnx_gem_detect(dev);
if (detect_rc == 0 && dev_data->phy_id != 0x00000000 &&
dev_data->phy_id != 0xFFFFFFFF &&
dev_data->phy_access_api != NULL) {
dev_data->phy_access_api->phy_reset_func(dev);
dev_data->phy_access_api->phy_configure_func(dev);
} else {
LOG_WRN("%s no compatible PHY detected", dev->name);
}
} | zephyrproject-rtos/zephyr | C++ | Apache License 2.0 | 9,573 |
/* Locate the writable area on the specified address. */ | void* exFLASH_Locate(u32 page_address, u16 len) | /* Locate the writable area on the specified address. */
void* exFLASH_Locate(u32 page_address, u16 len) | {
u16 i;
u16* ptr = (u16*)page_address;
for (i = 0; i < (0x0800 / len); i++) {
if (exFLASH_FindEmpty(ptr, len)) {
if (i == 0)
return 0;
break;
}
ptr += len / 2;
}
return ptr;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Callback function for AFEC conversion data is ready interrupt. */ | static void afec_set_data_ready_flag(void) | /* Callback function for AFEC conversion data is ready interrupt. */
static void afec_set_data_ready_flag(void) | {
is_data_ready = true;
afec_disable_interrupt(AFEC0, AFEC_INTERRUPT_DATA_READY);
tc_stop(TC0, 0);
} | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* ADC Enable Analog Watchdog for All Regular and/or Injected Channels.
The analog watchdog allows the monitoring of an analog signal between two threshold levels. The thresholds must be preset. Comparison is done before data alignment takes place, so the thresholds are left-aligned. */ | void adc_enable_analog_watchdog_on_all_channels(uint32_t adc) | /* ADC Enable Analog Watchdog for All Regular and/or Injected Channels.
The analog watchdog allows the monitoring of an analog signal between two threshold levels. The thresholds must be preset. Comparison is done before data alignment takes place, so the thresholds are left-aligned. */
void adc_enable_analog_watchdog_on_all_channels(uint32_t adc) | {
ADC_CR1(adc) &= ~ADC_CR1_AWDSGL;
} | insane-adding-machines/unicore-mx | C++ | GNU General Public License v3.0 | 50 |
/* dca_common_get_tag - return the dca tag (serves both new and old api) @dev - the device that wants dca service @cpu - the cpuid as returned by get_cpu() */ | u8 dca_common_get_tag(struct device *dev, int cpu) | /* dca_common_get_tag - return the dca tag (serves both new and old api) @dev - the device that wants dca service @cpu - the cpuid as returned by get_cpu() */
u8 dca_common_get_tag(struct device *dev, int cpu) | {
struct dca_provider *dca;
u8 tag;
unsigned long flags;
spin_lock_irqsave(&dca_lock, flags);
dca = dca_find_provider_by_dev(dev);
if (!dca) {
spin_unlock_irqrestore(&dca_lock, flags);
return -ENODEV;
}
tag = dca->ops->get_tag(dca, dev, cpu);
spin_unlock_irqrestore(&dca_lock, flags);
return tag;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Clear the SPI interrupt flag of the specified SPI port. */ | void SPIIntFlagClear(unsigned long ulBase) | /* Clear the SPI interrupt flag of the specified SPI port. */
void SPIIntFlagClear(unsigned long ulBase) | {
xASSERT((ulBase == SPI3_BASE) || (ulBase == SPI1_BASE)||
(ulBase == SPI2_BASE));
xHWREG(ulBase + SPI_SR) |= SPI_SR_CRCERR;
} | coocox/cox | C++ | Berkeley Software Distribution (BSD) | 104 |
/* For trigger consumers the current_trigger interface allows the trigger used by the device to be queried. */ | static ssize_t iio_trigger_read_current(struct device *dev, struct device_attribute *attr, char *buf) | /* For trigger consumers the current_trigger interface allows the trigger used by the device to be queried. */
static ssize_t iio_trigger_read_current(struct device *dev, struct device_attribute *attr, char *buf) | {
struct iio_dev *dev_info = dev_get_drvdata(dev);
int len = 0;
if (dev_info->trig)
len = snprintf(buf,
IIO_TRIGGER_NAME_LENGTH,
"%s\n",
dev_info->trig->name);
return len;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Change the cursor to point to the last record in the current block at the given level. Other levels are unaffected. */ | STATIC int xfs_btree_lastrec(xfs_btree_cur_t *cur, int level) | /* Change the cursor to point to the last record in the current block at the given level. Other levels are unaffected. */
STATIC int xfs_btree_lastrec(xfs_btree_cur_t *cur, int level) | {
struct xfs_btree_block *block;
xfs_buf_t *bp;
block = xfs_btree_get_block(cur, level, &bp);
xfs_btree_check_block(cur, block, level, bp);
if (!block->bb_numrecs)
return 0;
cur->bc_ptrs[level] = be16_to_cpu(block->bb_numrecs);
return 1;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Receives a character. Waits until a character is available. */ | static int ug_udbg_getc(void) | /* Receives a character. Waits until a character is available. */
static int ug_udbg_getc(void) | {
int ch;
while ((ch = ug_getc()) == -1)
barrier();
return ch;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* XXX - this gets a byte, not a character. */ | int file_getc(FILE_T file) | /* XXX - this gets a byte, not a character. */
int file_getc(FILE_T file) | {
unsigned char buf[1];
int ret;
if (file->err)
return -1;
if (file->have) {
file->have--;
file->pos++;
return *(file->next)++;
}
ret = file_read(buf, 1, file);
return ret < 1 ? -1 : buf[0];
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Replace the content of a Unicode string with the content of another Unicode string. */ | VOID ReplaceLeft(IN CHAR16 *Destination, IN CONST CHAR16 *Source) | /* Replace the content of a Unicode string with the content of another Unicode string. */
VOID ReplaceLeft(IN CHAR16 *Destination, IN CONST CHAR16 *Source) | {
CONST CHAR16 *EndString;
EndString = Source + StrLen (Source);
while (Source <= EndString) {
*Destination++ = *Source++;
}
} | tianocore/edk2 | C++ | Other | 4,240 |
/* LCD Light up or shut off Energy Mode indicator. */ | void LCD_EnergyMode(LCD_TypeDef *lcd, int em, int on) | /* LCD Light up or shut off Energy Mode indicator. */
void LCD_EnergyMode(LCD_TypeDef *lcd, int em, int on) | {
uint32_t com, bitvalue;
com = EFMDisplay.EMode.com[em];
bitvalue = 1 << EFMDisplay.EMode.bit[em];
if (on)
{
LCD_enableSegment(lcd, com, bitvalue);
}
else
{
LCD_disableSegment(lcd, com, bitvalue);
}
} | apopple/Pandaboard-FreeRTOS | C++ | null | 25 |
/* Get the MCU I/F IO mode run status. */ | u32 LCDC_MCUGetRunStatus(LCDC_TypeDef *LCDCx) | /* Get the MCU I/F IO mode run status. */
u32 LCDC_MCUGetRunStatus(LCDC_TypeDef *LCDCx) | {
assert_param(IS_LCDC_ALL_PERIPH(LCDCx));
if(LCDCx->LCDC_MCU_CFG & LCDC_MCU_CFG_IOMODE_RUN) {
return 1;
} else {
return 0;
}
} | alibaba/AliOS-Things | C++ | Apache License 2.0 | 4,536 |
/* Function used by tinflate_partial to read a byte from an address in the output buffer here it is implemented to directly read from the object memory of the d11 core */ | unsigned char tinflate_read_objmemx(void *out_base, unsigned long idx) | /* Function used by tinflate_partial to read a byte from an address in the output buffer here it is implemented to directly read from the object memory of the d11 core */
unsigned char tinflate_read_objmemx(void *out_base, unsigned long idx) | {
return wlc_bmac_read_objmem_byte((struct wlc_hw_info *) out_base, idx, OBJADDR_UCMX_SEL);
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Note that 'init' is a special process: it doesn't get signals it doesn't want to handle. Thus you cannot kill init even with a SIGKILL even by mistake. */ | asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs) | /* Note that 'init' is a special process: it doesn't get signals it doesn't want to handle. Thus you cannot kill init even with a SIGKILL even by mistake. */
asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs) | {
struct k_sigaction ka;
siginfo_t info;
int signr;
if (!user_mode(regs))
return 1;
if (!oldset)
oldset = ¤t->blocked;
signr = get_signal_to_deliver(&info, &ka, regs, NULL);
if (signr > 0) {
handle_signal(signr, &ka, &info, oldset, regs);
return 1;
}
if (regs->orig_d0 >= 0) {
handle_restart(regs, NULL, 0);
}
return 0;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Perform the hardware setup required by the ES449 in order to run the demo application. */ | static void prvSetupHardware(void) | /* Perform the hardware setup required by the ES449 in order to run the demo application. */
static void prvSetupHardware(void) | {
WDTCTL = WDTPW + WDTHOLD;
FLL_CTL0 |= DCOPLUS + XCAP18PF;
SCFI0 |= FN_4;
SCFQCTL = mainMAX_FREQUENCY;
P1SEL = 0x32;
P2SEL = 0x00;
P3SEL = 0x00;
P4SEL = 0xFC;
P5SEL = 0xFF;
} | apopple/Pandaboard-FreeRTOS | C++ | null | 25 |
/* 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: */ | int main(int argc, char *argv[]) | /* 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: */
int main(int argc, char *argv[]) | {
std::cout << "please provide in and out filename" << std::endl;
return 0;
}
state.decoder.color_convert = 0;
state.decoder.remember_unknown_chunks = 1;
lodepng::load_file(buffer, argv[1]);
error = lodepng::decode(image, w, h, state, buffer);
if(error) {
std::cout << "decoder error " << error << ": " << lodepng_error_text(error) << std::endl;
return 0;
}
buffer.clear();
state.encoder.text_compression = 1;
error = lodepng::encode(buffer, image, w, h, state);
if(error) {
std::cout << "encoder error " << error << ": " << lodepng_error_text(error) << std::endl;
return 0;
}
lodepng::save_file(buffer, argv[2]);
} | alibaba/AliOS-Things | C++ | Apache License 2.0 | 4,536 |
/* This function block guard time (BGT) of specified smartcard module. */ | void SC_SetBlockGuardTime(SC_T *sc, uint32_t u32BGT) | /* This function block guard time (BGT) of specified smartcard module. */
void SC_SetBlockGuardTime(SC_T *sc, uint32_t u32BGT) | {
sc->CTL = (sc->CTL & ~SC_CTL_BGT_Msk) | ((u32BGT - 1UL) << SC_CTL_BGT_Pos);
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Function: MX25_BE32K Arguments: flash_address, 32 bit flash memory address Description: The BE32K instruction is for erasing the data of the chosen sector (32KB) to be "1". Return Message: FlashAddressInvalid, FlashIsBusy, FlashOperationSuccess, FlashTimeOut */ | ReturnMsg MX25_BE32K(uint32_t flash_address) | /* Function: MX25_BE32K Arguments: flash_address, 32 bit flash memory address Description: The BE32K instruction is for erasing the data of the chosen sector (32KB) to be "1". Return Message: FlashAddressInvalid, FlashIsBusy, FlashOperationSuccess, FlashTimeOut */
ReturnMsg MX25_BE32K(uint32_t flash_address) | {
uint8_t addr_4byte_mode;
if( flash_address > FlashSize ) return FlashAddressInvalid;
if( IsFlashBusy() ) return FlashIsBusy;
if( IsFlash4Byte() )
addr_4byte_mode = TRUE;
else
addr_4byte_mode = FALSE;
MX25_WREN();
CS_Low();
SendByte( FLASH_CMD_BE32K, SIO );
SendFlashAddr( flash_address, SIO, addr_4byte_mode );
CS_High();
if( WaitFlashReady( BlockErase32KCycleTime ) )
return FlashOperationSuccess;
else
return FlashTimeOut;
} | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* This file is part of the Simba project. */ | int mock_write_network_interface_module_init(int res) | /* This file is part of the Simba project. */
int mock_write_network_interface_module_init(int res) | {
harness_mock_write("network_interface_module_init()",
NULL,
0);
harness_mock_write("network_interface_module_init(): return (res)",
&res,
sizeof(res));
return (0);
} | eerimoq/simba | C++ | Other | 337 |
/* Initialize interrupts.
Ensures all interrupts have their priority set to _EXC_IRQ_DEFAULT_PRIO and not 0, which they have it set to when coming out of reset. This ensures that interrupt locking via BASEPRI works as expected. */ | void z_arm_interrupt_init(void) | /* Initialize interrupts.
Ensures all interrupts have their priority set to _EXC_IRQ_DEFAULT_PRIO and not 0, which they have it set to when coming out of reset. This ensures that interrupt locking via BASEPRI works as expected. */
void z_arm_interrupt_init(void) | {
int irq = 0;
for (; irq < CONFIG_NUM_IRQS; irq++) {
NVIC_SetPriority((IRQn_Type)irq, _IRQ_PRIO_OFFSET);
}
} | zephyrproject-rtos/zephyr | C++ | Apache License 2.0 | 9,573 |
/* U: unsigned when set size: encoded in imm5 (see ARM ARM LowestSetBit()) */ | static void handle_simd_umov_smov(DisasContext *s, int is_q, int is_signed, int rn, int rd, int imm5) | /* U: unsigned when set size: encoded in imm5 (see ARM ARM LowestSetBit()) */
static void handle_simd_umov_smov(DisasContext *s, int is_q, int is_signed, int rn, int rd, int imm5) | {
int size = ctz32(imm5);
int element;
TCGv_i64 tcg_rd;
if (is_signed) {
if (size > 2 || (size == 2 && !is_q)) {
unallocated_encoding(s);
return;
}
} else {
if (size > 3
|| (size < 3 && is_q)
|| (size == 3 && !is_q)) {
unallocated_encoding(s);
return;
}
}
if (!fp_access_check(s)) {
return;
}
element = extract32(imm5, 1+size, 4);
tcg_rd = cpu_reg(s, rd);
read_vec_element(s, tcg_rd, rn, element, size | (is_signed ? MO_SIGN : 0));
if (is_signed && !is_q) {
tcg_gen_ext32u_i64(tcg_rd, tcg_rd);
}
} | ve3wwg/teensy3_qemu | C++ | Other | 15 |
/* ADC Window Monitoring mode configuration. This function configures ADC as Window Monitoring mode with below Settings.
GLCK for ADC -> GCLK_GENERATOR_1 (8MHz) CLK_ADC -> 512 KHz REFERENCE -> 1/2 VDDANA (1.65V) POSITIVE INPUT -> PA02 NEGATIVE INPUT -> GND Threshold low level -> 0.75V Monitor mode -> Above lower threshold */ | void configure_adc_window_monitor(void) | /* ADC Window Monitoring mode configuration. This function configures ADC as Window Monitoring mode with below Settings.
GLCK for ADC -> GCLK_GENERATOR_1 (8MHz) CLK_ADC -> 512 KHz REFERENCE -> 1/2 VDDANA (1.65V) POSITIVE INPUT -> PA02 NEGATIVE INPUT -> GND Threshold low level -> 0.75V Monitor mode -> Above lower threshold */
void configure_adc_window_monitor(void) | {
struct adc_config conf_adc;
adc_get_config_defaults(&conf_adc);
conf_adc.clock_source = GCLK_GENERATOR_1;
conf_adc.reference = ADC_REFERENCE_INTVCC1;
conf_adc.clock_prescaler = ADC_CLOCK_PRESCALER_DIV16;
conf_adc.positive_input = ADC_POSITIVE_INPUT_PIN0;
conf_adc.negative_input = ADC_NEGATIVE_INPUT_GND;
conf_adc.window.window_mode = ADC_WINDOW_MODE_ABOVE_LOWER;
conf_adc.window.window_lower_value = ADC_WINDOW_LOWER_THERSOLD_VALUE;
adc_init(&adc_instance, ADC, &conf_adc);
adc_enable(&adc_instance);
} | memfault/zero-to-main | C++ | null | 200 |
/* Function for converting SWI number to system interrupt number. */ | __STATIC_INLINE IRQn_Type nrf_drv_swi_irq_of(nrf_swi_t swi) | /* Function for converting SWI number to system interrupt number. */
__STATIC_INLINE IRQn_Type nrf_drv_swi_irq_of(nrf_swi_t swi) | {
return (IRQn_Type)((uint32_t)SWI0_IRQn + (uint32_t)swi);
} | labapart/polymcu | C++ | null | 201 |
/* Checks whether the specified PWR flag is set or not. */ | FlagStatus PWR_GetFlagStatus(uint32_t PWR_FLAG) | /* Checks whether the specified PWR flag is set or not. */
FlagStatus PWR_GetFlagStatus(uint32_t PWR_FLAG) | {
FlagStatus bitstatus = RESET;
assert_param(IS_PWR_GET_FLAG(PWR_FLAG));
if ((PWR->CSR & PWR_FLAG) != (uint32_t)RESET)
{
bitstatus = SET;
}
else
{
bitstatus = RESET;
}
return bitstatus;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Cycle through the APs sending Wakeup IPIs to boot each. */ | void __init smp_prepare_cpus(unsigned int max_cpus) | /* Cycle through the APs sending Wakeup IPIs to boot each. */
void __init smp_prepare_cpus(unsigned int max_cpus) | {
int boot_cpu_id = hard_smp_processor_id();
smp_setup_percpu_timer();
cpu_set(0, cpu_online_map);
cpu_set(0, cpu_callin_map);
local_cpu_data->loops_per_jiffy = loops_per_jiffy;
ia64_cpu_to_sapicid[0] = boot_cpu_id;
printk(KERN_INFO "Boot processor id 0x%x/0x%x\n", 0, boot_cpu_id);
current_thread_info()->cpu = 0;
if (!max_cpus) {
printk(KERN_INFO "SMP mode deactivated.\n");
init_cpu_online(cpumask_of(0));
init_cpu_present(cpumask_of(0));
init_cpu_possible(cpumask_of(0));
return;
}
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Given a path increment the reference count to the dentry and the vfsmount. */ | void path_get(struct path *path) | /* Given a path increment the reference count to the dentry and the vfsmount. */
void path_get(struct path *path) | {
mntget(path->mnt);
dget(path->dentry);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* RCC Turn on an Oscillator.
Enable an oscillator and power on. Each oscillator requires an amount of time to settle to a usable state. Refer to datasheets for time delay information. A status flag is available to indicate when the oscillator becomes ready (see */ | void rcc_osc_on(enum rcc_osc osc) | /* RCC Turn on an Oscillator.
Enable an oscillator and power on. Each oscillator requires an amount of time to settle to a usable state. Refer to datasheets for time delay information. A status flag is available to indicate when the oscillator becomes ready (see */
void rcc_osc_on(enum rcc_osc osc) | {
switch (osc) {
case RCC_PLL:
RCC_CR |= RCC_CR_PLLON;
break;
case RCC_HSE:
RCC_CR |= RCC_CR_HSEON;
break;
case RCC_HSI:
RCC_CR |= RCC_CR_HSION;
break;
case RCC_LSE:
RCC_BDCR |= RCC_BDCR_LSEON;
break;
case RCC_LSI:
RCC_CSR |= RCC_CSR_LSION;
break;
}
} | libopencm3/libopencm3 | C++ | GNU General Public License v3.0 | 2,931 |
/* This function ensures that the LEB reserved for garbage collection is marked as "taken" in lprops. We also have to set free space to LEB size and dirty space to zero, because lprops may contain out-of-date information if the file-system was un-mounted before it has been committed. This function returns zero in case of success and a negative error code in case of failure. */ | static int take_gc_lnum(struct ubifs_info *c) | /* This function ensures that the LEB reserved for garbage collection is marked as "taken" in lprops. We also have to set free space to LEB size and dirty space to zero, because lprops may contain out-of-date information if the file-system was un-mounted before it has been committed. This function returns zero in case of success and a negative error code in case of failure. */
static int take_gc_lnum(struct ubifs_info *c) | {
int err;
if (c->gc_lnum == -1) {
ubifs_err("no LEB for GC");
return -EINVAL;
}
err = ubifs_change_one_lp(c, c->gc_lnum, c->leb_size, 0,
LPROPS_TAKEN, 0, 0);
return err;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* This function returns %1 if the key is in range and %0 otherwise. */ | static int key_in_range(struct ubifs_info *c, union ubifs_key *key, union ubifs_key *from_key, union ubifs_key *to_key) | /* This function returns %1 if the key is in range and %0 otherwise. */
static int key_in_range(struct ubifs_info *c, union ubifs_key *key, union ubifs_key *from_key, union ubifs_key *to_key) | {
if (keys_cmp(c, key, from_key) < 0)
return 0;
if (keys_cmp(c, key, to_key) > 0)
return 0;
return 1;
} | EmcraftSystems/u-boot | C++ | Other | 181 |
/* The parameter must have been received from ShellCommandConsistMappingInitialize. */ | EFI_STATUS EFIAPI ShellCommandConsistMappingUnInitialize(EFI_DEVICE_PATH_PROTOCOL **Table) | /* The parameter must have been received from ShellCommandConsistMappingInitialize. */
EFI_STATUS EFIAPI ShellCommandConsistMappingUnInitialize(EFI_DEVICE_PATH_PROTOCOL **Table) | {
UINTN Index;
ASSERT (Table != NULL);
for (Index = 0; Table[Index] != NULL; Index++) {
FreePool (Table[Index]);
}
FreePool (Table);
return EFI_SUCCESS;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Wait until an operation is completed by checking a bit in a register up to @attempts times. If @valp is not NULL the value of the register at the time it indicated completion is stored there. Returns 0 if the operation completes and -EAGAIN otherwise. */ | int t3_wait_op_done_val(struct adapter *adapter, int reg, u32 mask, int polarity, int attempts, int delay, u32 *valp) | /* Wait until an operation is completed by checking a bit in a register up to @attempts times. If @valp is not NULL the value of the register at the time it indicated completion is stored there. Returns 0 if the operation completes and -EAGAIN otherwise. */
int t3_wait_op_done_val(struct adapter *adapter, int reg, u32 mask, int polarity, int attempts, int delay, u32 *valp) | {
while (1) {
u32 val = t3_read_reg(adapter, reg);
if (!!(val & mask) == polarity) {
if (valp)
*valp = val;
return 0;
}
if (--attempts == 0)
return -EAGAIN;
if (delay)
udelay(delay);
}
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* vxge_hw_device_stats_get - Get the device hw statistics. Returns the vpath h/w stats for the device. */ | enum vxge_hw_status vxge_hw_device_stats_get(struct __vxge_hw_device *hldev, struct vxge_hw_device_stats_hw_info *hw_stats) | /* vxge_hw_device_stats_get - Get the device hw statistics. Returns the vpath h/w stats for the device. */
enum vxge_hw_status vxge_hw_device_stats_get(struct __vxge_hw_device *hldev, struct vxge_hw_device_stats_hw_info *hw_stats) | {
u32 i;
enum vxge_hw_status status = VXGE_HW_OK;
for (i = 0; i < VXGE_HW_MAX_VIRTUAL_PATHS; i++) {
if (!(hldev->vpaths_deployed & vxge_mBIT(i)) ||
(hldev->virtual_paths[i].vp_open ==
VXGE_HW_VP_NOT_OPEN))
continue;
memcpy(hldev->virtual_paths[i].hw_stats_sav,
hldev->virtual_paths[i].hw_stats,
sizeof(struct vxge_hw_vpath_stats_hw_info));
status = __vxge_hw_vpath_stats_get(
&hldev->virtual_paths[i],
hldev->virtual_paths[i].hw_stats);
}
memcpy(hw_stats, &hldev->stats.hw_dev_info_stats,
sizeof(struct vxge_hw_device_stats_hw_info));
return status;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Initialize SMM profile in SmmReadyToLock protocol callback function. */ | EFI_STATUS EFIAPI InitSmmProfileCallBack(IN CONST EFI_GUID *Protocol, IN VOID *Interface, IN EFI_HANDLE Handle) | /* Initialize SMM profile in SmmReadyToLock protocol callback function. */
EFI_STATUS EFIAPI InitSmmProfileCallBack(IN CONST EFI_GUID *Protocol, IN VOID *Interface, IN EFI_HANDLE Handle) | {
gRT->SetVariable (
SMM_PROFILE_NAME,
&gEfiCallerIdGuid,
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
sizeof (mSmmProfileBase),
&mSmmProfileBase
);
GetSmiCommandPort ();
InitProtectedMemRange ();
return EFI_SUCCESS;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* qedma3_stop - stops dma on the channel passed @base: base address of edma @cfg: pinter to struct edma3_channel_config which was passed to qedma3_start when you started qdma channel */ | void qedma3_stop(u32 base, struct edma3_channel_config *cfg) | /* qedma3_stop - stops dma on the channel passed @base: base address of edma @cfg: pinter to struct edma3_channel_config which was passed to qedma3_start when you started qdma channel */
void qedma3_stop(u32 base, struct edma3_channel_config *cfg) | {
__raw_writel(1 << cfg->chnum, base + EDMA3_QEECR);
if (cfg->complete_code < 32)
__raw_writel(1 << cfg->complete_code, base + EDMA3_ICR);
else
__raw_writel(1 << cfg->complete_code, base + EDMA3_ICRH);
__raw_writel(1 << cfg->chnum, base + EDMA3_QSECR);
__raw_writel(1 << cfg->chnum, base + EDMA3_QEMCR);
__raw_writel(0, base + EDMA3_QCHMAP(cfg->chnum));
} | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* This function is to convert a UINTN to a ASCII string, and return the actual length of the buffer. */ | UINTN PxeBcUintnToAscDec(IN UINTN Number, IN UINT8 *Buffer, IN UINTN BufferSize) | /* This function is to convert a UINTN to a ASCII string, and return the actual length of the buffer. */
UINTN PxeBcUintnToAscDec(IN UINTN Number, IN UINT8 *Buffer, IN UINTN BufferSize) | {
UINTN Index;
UINTN Length;
CHAR8 TempStr[64];
Index = 63;
TempStr[Index] = 0;
do {
Index--;
TempStr[Index] = (CHAR8)('0' + (Number % 10));
Number = (UINTN)(Number / 10);
} while (Number != 0);
AsciiStrCpyS ((CHAR8 *)Buffer, BufferSize, &TempStr[Index]);
Length = AsciiStrLen ((CHAR8 *)Buffer);
return Length;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* ZigBee Device Profile dissector for the simple descriptor */ | void dissect_zbee_zdp_rsp_simple_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 version) | /* ZigBee Device Profile dissector for the simple descriptor */
void dissect_zbee_zdp_rsp_simple_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 version) | {
guint offset = 0;
guint8 status;
guint16 device;
status = zdp_parse_status(tree, tvb, &offset);
device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, (int)sizeof(guint16), NULL); zbee_parse_uint(tree, hf_zbee_zdp_simple_length, tvb, &offset, (int)sizeof(guint8), NULL);
if (status == ZBEE_ZDP_STATUS_SUCCESS) {
zdp_parse_simple_desc(tree, ett_zbee_zdp_simple, tvb, &offset, version);
}
zbee_append_info(tree, pinfo, ", Device: 0x%04x", device);
zbee_append_info(tree, pinfo, ", Status: %s", zdp_status_name(status));
zdp_dump_excess(tvb, offset, pinfo, tree);
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Returns: a pointer to the found character or NULL */ | gchar* g_utf8_find_next_char(const gchar *p, const gchar *end) | /* Returns: a pointer to the found character or NULL */
gchar* g_utf8_find_next_char(const gchar *p, const gchar *end) | {
if (*p)
{
if (end)
for (++p; p < end && (*p & 0xc0) == 0x80; ++p)
;
else
for (++p; (*p & 0xc0) == 0x80; ++p)
;
}
return (p == end) ? NULL : (gchar *)p;
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* This is the callback from RPC telling us whether a reply was received or some error occurred (timeout or socket shutdown). */ | int nfs_readpage_result(struct rpc_task *task, struct nfs_read_data *data) | /* This is the callback from RPC telling us whether a reply was received or some error occurred (timeout or socket shutdown). */
int nfs_readpage_result(struct rpc_task *task, struct nfs_read_data *data) | {
int status;
dprintk("NFS: %s: %5u, (status %d)\n", __func__, task->tk_pid,
task->tk_status);
status = NFS_PROTO(data->inode)->read_done(task, data);
if (status != 0)
return status;
nfs_add_stats(data->inode, NFSIOS_SERVERREADBYTES, data->res.count);
if (task->tk_status == -ESTALE) {
set_bit(NFS_INO_STALE, &NFS_I(data->inode)->flags);
nfs_mark_for_revalidate(data->inode);
}
return 0;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Stops the simple rumble on a haptic device. */ | int SDL_HapticRumbleStop(SDL_Haptic *haptic) | /* Stops the simple rumble on a haptic device. */
int SDL_HapticRumbleStop(SDL_Haptic *haptic) | {
if (!ValidHaptic(haptic)) {
return -1;
}
if (haptic->rumble_id < 0) {
return SDL_SetError("Haptic: Rumble effect not initialized on haptic device");
}
return SDL_HapticStopEffect(haptic, haptic->rumble_id);
} | alibaba/AliOS-Things | C++ | Apache License 2.0 | 4,536 |
/* Write a data buffer to the slave, when the master have obtained
This function is always used in thread mode. */ | unsigned long xI2CMasterWriteBufS2(unsigned long ulBase, const unsigned char *pucDataBuf, unsigned long ulLen, xtBoolean bEndTransmition) | /* Write a data buffer to the slave, when the master have obtained
This function is always used in thread mode. */
unsigned long xI2CMasterWriteBufS2(unsigned long ulBase, const unsigned char *pucDataBuf, unsigned long ulLen, xtBoolean bEndTransmition) | {
unsigned long i;
unsigned long ulStatus;
xASSERT((ulBase == I2C0_BASE) || (ulBase == I2C1_BASE));
xASSERT(pucDataBuf);
for(i = 0; i < ulLen - 1; i++)
{
ulStatus = I2CByteSend(ulBase, *pucDataBuf++);
if(!(ulStatus == I2C_I2STAT_M_TX_DAT_ACK))
{
I2CStopSend(ulBase);
return i;
}
}
ulStatus = I2CByteSend(ulBase, *pucDataBuf);
if(!(ulStatus == I2C_I2STAT_M_TX_DAT_ACK))
{
I2CStopSend(ulBase);
return i;
}
if(bEndTransmition)
{
I2CStopSend(ulBase);
}
return ulLen;
} | coocox/cox | C++ | Berkeley Software Distribution (BSD) | 104 |
/* Draws the special function pallet entry text labels.
This function draws the special function pallet entry text labels to the appropriate positions on the display. */ | static void draw_pallet_labels(const bool clearing_display) | /* Draws the special function pallet entry text labels.
This function draws the special function pallet entry text labels to the appropriate positions on the display. */
static void draw_pallet_labels(const bool clearing_display) | {
gfx_draw_string_aligned("MUL",
PALLET_COLOR_WIDTH / 2,
gfx_get_height() - (PALLET_HEIGHT / 2), &sysfont,
GFX_COLOR_TRANSPARENT, GFX_COLOR_WHITE,
TEXT_POS_CENTER, TEXT_ALIGN_LEFT);
gfx_draw_string_aligned("CLR",
(PALLET_COLOR_WIDTH * NUM_PALLET_COLORS) - (PALLET_COLOR_WIDTH / 2),
gfx_get_height() - (PALLET_HEIGHT / 2), &sysfont,
GFX_COLOR_TRANSPARENT,
clearing_display ? GFX_COLOR_RED : GFX_COLOR_WHITE,
TEXT_POS_CENTER, TEXT_ALIGN_LEFT);
} | memfault/zero-to-main | C++ | null | 200 |
/* Change Logs: Date Author Notes bernard first version lgnq modified according bernard's implementation. bernard code cleanup bernard fix compiler warning. bernard use RT_SERIAL_RB_BUFSZ to define the size of ring buffer. bernard rewrite serial framework Serial poll routines */ | rt_inline int _serial_poll_rx(struct rt_serial_device *serial, rt_uint8_t *data, int length) | /* Change Logs: Date Author Notes bernard first version lgnq modified according bernard's implementation. bernard code cleanup bernard fix compiler warning. bernard use RT_SERIAL_RB_BUFSZ to define the size of ring buffer. bernard rewrite serial framework Serial poll routines */
rt_inline int _serial_poll_rx(struct rt_serial_device *serial, rt_uint8_t *data, int length) | {
int ch;
int size;
RT_ASSERT(serial != RT_NULL);
size = length;
while (length)
{
ch = serial->ops->getc(serial);
*data = ch;
data ++; length --;
if (ch == '\n') break;
}
return size - length;
} | armink/FreeModbus_Slave-Master-RTT-STM32 | C++ | Other | 1,477 |
/* Enable USB Device Endpoint Parameters: EPNum: Device Endpoint Number EPNum.0..3: Address EPNum.7: Dir Return Value: None */ | void USBD_EnableEP(uint32_t EPNum) | /* Enable USB Device Endpoint Parameters: EPNum: Device Endpoint Number EPNum.0..3: Address EPNum.7: Dir Return Value: None */
void USBD_EnableEP(uint32_t EPNum) | {
if (EPNum & 0x80) {
EPNum &= 0x0F;
USB0->ENDPOINT[EPNum].ENDPT |= USB_ENDPT_EPHSHK_MASK |
USB_ENDPT_EPTXEN_MASK;
} else {
USB0->ENDPOINT[EPNum].ENDPT |= USB_ENDPT_EPHSHK_MASK |
USB_ENDPT_EPRXEN_MASK;
}
} | ARMmbed/DAPLink | C++ | Apache License 2.0 | 2,140 |
/* ks8695_set_mac - Update MAC in net dev and HW @ndev: The network device to update @addr: The new MAC address to set */ | static int ks8695_set_mac(struct net_device *ndev, void *addr) | /* ks8695_set_mac - Update MAC in net dev and HW @ndev: The network device to update @addr: The new MAC address to set */
static int ks8695_set_mac(struct net_device *ndev, void *addr) | {
struct ks8695_priv *ksp = netdev_priv(ndev);
struct sockaddr *address = addr;
if (!is_valid_ether_addr(address->sa_data))
return -EADDRNOTAVAIL;
memcpy(ndev->dev_addr, address->sa_data, ndev->addr_len);
ks8695_update_mac(ksp);
dev_dbg(ksp->dev, "%s: Updated MAC address to %pM\n",
ndev->name, ndev->dev_addr);
return 0;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Checks whether the specified I2C flag is set or not. */ | u8 I2C_CheckFlagState(I2C_TypeDef *I2Cx, u32 I2C_FLAG) | /* Checks whether the specified I2C flag is set or not. */
u8 I2C_CheckFlagState(I2C_TypeDef *I2Cx, u32 I2C_FLAG) | {
u8 bit_status = 0;
assert_param(IS_I2C_ALL_PERIPH(I2Cx));
if((I2Cx->IC_STATUS & I2C_FLAG) != 0)
{
bit_status = 1;
}
return bit_status;
} | alibaba/AliOS-Things | C++ | Apache License 2.0 | 4,536 |
/* param base CMP peripheral base address. param positiveChannel Positive side input channel number. Available range is 0-7. param negativeChannel Negative side input channel number. Available range is 0-7. */ | void CMP_SetInputChannels(CMP_Type *base, uint8_t positiveChannel, uint8_t negativeChannel) | /* param base CMP peripheral base address. param positiveChannel Positive side input channel number. Available range is 0-7. param negativeChannel Negative side input channel number. Available range is 0-7. */
void CMP_SetInputChannels(CMP_Type *base, uint8_t positiveChannel, uint8_t negativeChannel) | {
uint8_t tmp8 = base->MUXCR;
tmp8 &= ~(uint8_t)(CMP_MUXCR_PSEL_MASK | CMP_MUXCR_MSEL_MASK);
tmp8 |= CMP_MUXCR_PSEL(positiveChannel) | CMP_MUXCR_MSEL(negativeChannel);
base->MUXCR = tmp8;
} | eclipse-threadx/getting-started | C++ | Other | 310 |
/* Designates the specified function as the IAS callback. This callback is necessary for this service to function properly. */ | void ble_svc_ias_set_cb(ble_svc_ias_event_fn *cb) | /* Designates the specified function as the IAS callback. This callback is necessary for this service to function properly. */
void ble_svc_ias_set_cb(ble_svc_ias_event_fn *cb) | {
ble_svc_ias_cb_fn = cb;
} | arendst/Tasmota | C++ | GNU General Public License v3.0 | 21,318 |
/* returns: 1 if image is of given type 0 otherwise (or on error) */ | int fit_image_check_type(const void *fit, int noffset, uint8_t type) | /* returns: 1 if image is of given type 0 otherwise (or on error) */
int fit_image_check_type(const void *fit, int noffset, uint8_t type) | {
uint8_t image_type;
if (fit_image_get_type(fit, noffset, &image_type))
return 0;
return (type == image_type);
} | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* Polls the device for a new X/Y/Z reading. */ | err_t l3gd20Poll(l3gd20Data_t *data) | /* Polls the device for a new X/Y/Z reading. */
err_t l3gd20Poll(l3gd20Data_t *data) | {
uint8_t timeout = 0;
uint8_t buffer;
if (!_l3gd20Initialised)
{
ASSERT_STATUS(l3gd20Init());
}
do
{
ASSERT_STATUS(l3gd20Read8(L3GD20_REGISTER_STATUS_REG, &buffer));
ASSERT(timeout++ <= L3GD20_POLL_TIMEOUT, ERROR_OPERATIONTIMEDOUT);
} while (!(buffer & (1<<3)));
ASSERT_STATUS(l3gd20Read48(L3GD20_REGISTER_OUT_X_L | (1<<7), &(data->x), &(data->y), &(data->z)));
return ERROR_NONE;
} | microbuilder/LPC11U_LPC13U_CodeBase | C++ | Other | 54 |
/* 'mxml_string_putc()' - Write a character to a string. */ | static int mxml_string_putc(int ch, void *p) | /* 'mxml_string_putc()' - Write a character to a string. */
static int mxml_string_putc(int ch, void *p) | {
char **pp;
pp = (char **)p;
if (pp[0] < pp[1])
pp[0][0] = ch;
pp[0] ++;
return (0);
} | DC-SWAT/DreamShell | C++ | null | 404 |
/* Calculate culmulative frequency for next symbol. Does NO update! */ | static int range_decode_culfreq(APEContext *ctx, int tot_f) | /* Calculate culmulative frequency for next symbol. Does NO update! */
static int range_decode_culfreq(APEContext *ctx, int tot_f) | {
range_dec_normalize(ctx);
ctx->rc.help = ctx->rc.range / tot_f;
return ctx->rc.low / ctx->rc.help;
} | DC-SWAT/DreamShell | C++ | null | 404 |
/* Cleans up any open serial ports on the exit. */ | static void native_tty_cleanup_uart(void) | /* Cleans up any open serial ports on the exit. */
static void native_tty_cleanup_uart(void) | {
DT_INST_FOREACH_STATUS_OKAY(NATIVE_TTY_CLEANUP);
} | zephyrproject-rtos/zephyr | C++ | Apache License 2.0 | 9,573 |
/* This function handles USB On The Go FS End Point 1 Out global interrupt. */ | void OTG_FS_EP1_OUT_IRQHandler(void) | /* This function handles USB On The Go FS End Point 1 Out global interrupt. */
void OTG_FS_EP1_OUT_IRQHandler(void) | {
HAL_PCD_IRQHandler(&hpcd_USB_OTG_FS);
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Performs write operation to Omer analog register specified. */ | static s32 ixgbe_write_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 val) | /* Performs write operation to Omer analog register specified. */
static s32 ixgbe_write_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 val) | {
u32 core_ctl;
core_ctl = (reg << 8) | val;
IXGBE_WRITE_REG(hw, IXGBE_CORECTL, core_ctl);
IXGBE_WRITE_FLUSH(hw);
udelay(10);
return 0;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* CRC MSP De-Initialization This function freeze the hardware resources used in this example: */ | void HAL_CRC_MspDeInit(CRC_HandleTypeDef *hcrc) | /* CRC MSP De-Initialization This function freeze the hardware resources used in this example: */
void HAL_CRC_MspDeInit(CRC_HandleTypeDef *hcrc) | {
__HAL_RCC_CRC_FORCE_RESET();
__HAL_RCC_CRC_RELEASE_RESET();
} | STMicroelectronics/STM32CubeF4 | C++ | Other | 789 |
/* state_change - record that the glock is now in a different state @gl: the glock @new_state the new state */ | static void state_change(struct gfs2_glock *gl, unsigned int new_state) | /* state_change - record that the glock is now in a different state @gl: the glock @new_state the new state */
static void state_change(struct gfs2_glock *gl, unsigned int new_state) | {
int held1, held2;
held1 = (gl->gl_state != LM_ST_UNLOCKED);
held2 = (new_state != LM_ST_UNLOCKED);
if (held1 != held2) {
if (held2)
gfs2_glock_hold(gl);
else
gfs2_glock_put_nolock(gl);
}
gl->gl_state = new_state;
gl->gl_tchange = jiffies;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* The procedure xdrmem_create initializes a stream descriptor for a memory buffer. */ | void xdrmem_create(XDR *xdrs, const char *addr, unsigned int size, enum xdr_op op) | /* The procedure xdrmem_create initializes a stream descriptor for a memory buffer. */
void xdrmem_create(XDR *xdrs, const char *addr, unsigned int size, enum xdr_op op) | {
xdrs->x_op = op;
xdrs->x_ops = &xdrmem_ops;
xdrs->x_private = xdrs->x_base = (char*)addr;
xdrs->x_handy = size;
} | pikasTech/PikaPython | C++ | MIT License | 1,403 |
/* Gets interrupt status for the specified GPIO port. */ | long GPIOIntStatus(unsigned long ulPort, tBoolean bMasked) | /* Gets interrupt status for the specified GPIO port. */
long GPIOIntStatus(unsigned long ulPort, tBoolean bMasked) | {
ASSERT(GPIOBaseValid(ulPort));
if(bMasked)
{
return(HWREG(ulPort + GPIO_O_GPIO_MIS));
}
else
{
return(HWREG(ulPort + GPIO_O_GPIO_RIS));
}
} | micropython/micropython | C++ | Other | 18,334 |
/* We filter at user level, since the kernel driver does't process the packets */ | static int TcSetFilter(pcap_t *p, struct bpf_program *fp) | /* We filter at user level, since the kernel driver does't process the packets */
static int TcSetFilter(pcap_t *p, struct bpf_program *fp) | {
if(!fp)
{
strncpy(p->errbuf, "setfilter: No filter specified", sizeof(p->errbuf));
return -1;
}
if (install_bpf_program(p, fp) < 0)
{
return -1;
}
return 0;
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* This routine find the offset of the last period '.' of string. If No period exists function FileNameExtension is set to L'\0' */ | static VOID SplitFileNameExtension(IN CHAR16 *FileName, OUT CHAR16 *FileNameFirst, OUT CHAR16 *FileNameExtension) | /* This routine find the offset of the last period '.' of string. If No period exists function FileNameExtension is set to L'\0' */
static VOID SplitFileNameExtension(IN CHAR16 *FileName, OUT CHAR16 *FileNameFirst, OUT CHAR16 *FileNameExtension) | {
UINTN Index;
UINTN StringLen;
StringLen = StrnLenS (FileName, MAX_FILE_NAME_SIZE);
for (Index = StringLen; Index > 0 && FileName[Index] != L'.'; Index--) {
}
if ((Index == 0) && (FileName[Index] != L'.')) {
FileNameExtension[0] = L'\0';
Index = StringLen;
} else {
StrCpyS (FileNameExtension, MAX_FILE_NAME_SIZE, &FileName[Index+1]);
}
StrnCpyS (FileNameFirst, MAX_FILE_NAME_SIZE, FileName, Index);
FileNameFirst[Index] = L'\0';
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Calculate and store in 'output' the MD5 digest of 'len' bytes at 'input'. 'output' must have enough space to hold 16 bytes. */ | void md5(unsigned char *input, int len, unsigned char output[16]) | /* Calculate and store in 'output' the MD5 digest of 'len' bytes at 'input'. 'output' must have enough space to hold 16 bytes. */
void md5(unsigned char *input, int len, unsigned char output[16]) | {
struct MD5Context context;
MD5Init(&context);
MD5Update(&context, input, len);
MD5Final(output, &context);
} | EmcraftSystems/u-boot | C++ | Other | 181 |
/* This one is only used for pages with the global bit set so we don't care much about the ASID. */ | void local_flush_tlb_one(unsigned long page) | /* This one is only used for pages with the global bit set so we don't care much about the ASID. */
void local_flush_tlb_one(unsigned long page) | {
unsigned long flags;
int oldpid, idx;
local_irq_save(flags);
oldpid = pevn_get();
page &= (PAGE_MASK << 1);
pevn_set(page);
barrier();
tlb_probe();
idx = tlbpt_get();
pectx_set(0);
if (idx >= 0) {
pevn_set(KSEG1);
barrier();
tlb_write_indexed();
}
pevn_set(oldpid);
local_irq_restore(flags);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Sets the integration time to the specified value. */ | uint8_t tcs34725SetIntegrationTime(tcs34725IntegrationTime_t it, lua_State *L) | /* Sets the integration time to the specified value. */
uint8_t tcs34725SetIntegrationTime(tcs34725IntegrationTime_t it, lua_State *L) | {
if (!_tcs34725Initialised)
{
tcs34725Setup(L);
}
tcs34725Write8(TCS34725_ATIME, it);
_tcs34725IntegrationTime = it;
return 0;
} | nodemcu/nodemcu-firmware | C++ | MIT License | 7,566 |
/* get the file handle for the "/" directory on the server */ | static int nfs4_proc_get_root(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fsinfo *info) | /* get the file handle for the "/" directory on the server */
static int nfs4_proc_get_root(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fsinfo *info) | {
int status;
status = nfs4_lookup_root(server, fhandle, info);
if (status == 0)
status = nfs4_server_capabilities(server, fhandle);
if (status == 0)
status = nfs4_do_fsinfo(server, fhandle, info);
return nfs4_map_errors(status);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Setup separate stacks for certain exception handlers. If the input Buffer and BufferSize are both NULL, use global variable if possible. */ | EFI_STATUS EFIAPI InitializeSeparateExceptionStacks(IN VOID *Buffer, IN OUT UINTN *BufferSize) | /* Setup separate stacks for certain exception handlers. If the input Buffer and BufferSize are both NULL, use global variable if possible. */
EFI_STATUS EFIAPI InitializeSeparateExceptionStacks(IN VOID *Buffer, IN OUT UINTN *BufferSize) | {
if ((Buffer == NULL) && (BufferSize == NULL)) {
return EFI_UNSUPPORTED;
}
return ArchSetupExceptionStack (Buffer, BufferSize);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Gets the selected ADC Software start conversion Status. */ | FlagStatus ADC_GetSoftwareStartConvStatus(ADC_TypeDef *ADCx) | /* Gets the selected ADC Software start conversion Status. */
FlagStatus ADC_GetSoftwareStartConvStatus(ADC_TypeDef *ADCx) | {
FlagStatus bitstatus = RESET;
assert_param(IS_ADC_ALL_PERIPH(ADCx));
if ((ADCx->CR2 & ADC_CR2_SWSTART) != (uint32_t)RESET)
{
bitstatus = SET;
}
else
{
bitstatus = RESET;
}
return bitstatus;
} | avem-labs/Avem | C++ | MIT License | 1,752 |
/* This file is part of the Simba project. */ | int mock_write_emacs(const char *path_p, void *chin_p, void *chout_p, int res) | /* This file is part of the Simba project. */
int mock_write_emacs(const char *path_p, void *chin_p, void *chout_p, int res) | {
harness_mock_write("emacs(path_p)",
path_p,
strlen(path_p) + 1);
harness_mock_write("emacs(chin_p)",
chin_p,
sizeof(chin_p));
harness_mock_write("emacs(chout_p)",
chout_p,
sizeof(chout_p));
harness_mock_write("emacs(): return (res)",
&res,
sizeof(res));
return (0);
} | eerimoq/simba | C++ | Other | 337 |
/* Deselect given device on the SPI bus.
Calls board chip deselect. */ | void spi_deselect_device(SPI_t *spi, struct spi_device *device) | /* Deselect given device on the SPI bus.
Calls board chip deselect. */
void spi_deselect_device(SPI_t *spi, struct spi_device *device) | {
ioport_set_pin_high(device->id);
} | memfault/zero-to-main | C++ | null | 200 |
/* TIM_Base MSP Initialization This function configures the hardware resources used in this example. */ | void HAL_TIM_Base_MspInit(TIM_HandleTypeDef *htim_base) | /* TIM_Base MSP Initialization This function configures the hardware resources used in this example. */
void HAL_TIM_Base_MspInit(TIM_HandleTypeDef *htim_base) | {
if(htim_base->Instance==TIM2)
{
__HAL_RCC_TIM2_CLK_ENABLE();
}
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Note on skb management : After calling the lower layers of the IrDA stack, we always kfree() the skb, which drop the reference count (and potentially destroy it). IrLMP and IrLAP may queue the packet, and in those cases will need to use skb_get() to keep it around. Jean II */ | int irlmp_data_request(struct lsap_cb *self, struct sk_buff *userdata) | /* Note on skb management : After calling the lower layers of the IrDA stack, we always kfree() the skb, which drop the reference count (and potentially destroy it). IrLMP and IrLAP may queue the packet, and in those cases will need to use skb_get() to keep it around. Jean II */
int irlmp_data_request(struct lsap_cb *self, struct sk_buff *userdata) | {
int ret;
IRDA_ASSERT(self != NULL, return -1;);
IRDA_ASSERT(self->magic == LMP_LSAP_MAGIC, return -1;);
IRDA_ASSERT(skb_headroom(userdata) >= LMP_HEADER, return -1;);
skb_push(userdata, LMP_HEADER);
ret = irlmp_do_lsap_event(self, LM_DATA_REQUEST, userdata);
dev_kfree_skb(userdata);
return ret;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Callback function for asserts in the SoftDevice.
This function will be called if the ASSERT macro in the SoftDevice fails. Function declaration can be found in the nrf_assert.h file. */ | void assert_nrf_callback(uint16_t line_num, const uint8_t *p_file_name) | /* Callback function for asserts in the SoftDevice.
This function will be called if the ASSERT macro in the SoftDevice fails. Function declaration can be found in the nrf_assert.h file. */
void assert_nrf_callback(uint16_t line_num, const uint8_t *p_file_name) | {
app_error_handler(SER_SD_ERROR_CODE, line_num, p_file_name);
}
/** @} | labapart/polymcu | C++ | null | 201 |
/* Restart an (async) RPC call. Usually called from within the exit handler. */ | void rpc_restart_call(struct rpc_task *task) | /* Restart an (async) RPC call. Usually called from within the exit handler. */
void rpc_restart_call(struct rpc_task *task) | {
if (RPC_ASSASSINATED(task))
return;
task->tk_action = call_start;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* change char to int value based on Hex. */ | INTN HBufferImageCharToHex(IN CHAR16 Char) | /* change char to int value based on Hex. */
INTN HBufferImageCharToHex(IN CHAR16 Char) | {
if ((Char >= L'0') && (Char <= L'9')) {
return (Char - L'0');
}
if ((Char >= L'a') && (Char <= L'f')) {
return (Char - L'a' + 10);
}
if ((Char >= L'A') && (Char <= L'F')) {
return (Char - L'A' + 10);
}
return -1;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* This backend exposes an additional "filename" property that can be used to set the filename to use to open the backend. */ | static void entropy_available(void *opaque) | /* This backend exposes an additional "filename" property that can be used to set the filename to use to open the backend. */
static void entropy_available(void *opaque) | {
RndRandom *s = RNG_RANDOM(opaque);
uint8_t buffer[s->size];
ssize_t len;
len = read(s->fd, buffer, s->size);
if (len < 0 && errno == EAGAIN) {
return;
}
g_assert(len != -1);
s->receive_func(s->opaque, buffer, len);
s->receive_func = NULL;
qemu_set_fd_handler(s->fd, NULL, NULL, NULL);
} | ve3wwg/teensy3_qemu | C++ | Other | 15 |
/* STUSB1602 sets the VDD_OVLO_Threshold State (EN or DIS) (bit6 0x2E */ | STUSB1602_StatusTypeDef STUSB1602_VDD_OVLO_Threshold_Set(uint8_t Addr, VDD_OVLO_Threshold_TypeDef st) | /* STUSB1602 sets the VDD_OVLO_Threshold State (EN or DIS) (bit6 0x2E */
STUSB1602_StatusTypeDef STUSB1602_VDD_OVLO_Threshold_Set(uint8_t Addr, VDD_OVLO_Threshold_TypeDef st) | {
STUSB1602_StatusTypeDef status = STUSB1602_OK;
STUSB1602_VBUS_MONITORING_CTRL_RegTypeDef reg;
STUSB1602_ReadReg(®.d8, Addr, STUSB1602_VBUS_MONITORING_CTRL_REG, 1);
reg.b.VDD_OVLO_DISABLE = st;
status = STUSB1602_WriteReg(®.d8, Addr, STUSB1602_VBUS_MONITORING_CTRL_REG, 1);
return status;
} | st-one/X-CUBE-USB-PD | C++ | null | 110 |
/* Queries the current Ethernet MAC remote wake-up configuration. */ | uint32_t EMACPowerManagementControlGet(uint32_t ui32Base) | /* Queries the current Ethernet MAC remote wake-up configuration. */
uint32_t EMACPowerManagementControlGet(uint32_t ui32Base) | {
ASSERT(ui32Base == EMAC0_BASE);
return (HWREG(ui32Base + EMAC_O_PMTCTLSTAT) &
(EMAC_PMTCTLSTAT_GLBLUCAST | EMAC_PMTCTLSTAT_WUPFREN |
EMAC_PMTCTLSTAT_MGKPKTEN | EMAC_PMTCTLSTAT_PWRDWN));
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* This function writes orphan nodes for all the orphans to commit. On success, %0 is returned, otherwise a negative error code is returned. */ | static int write_orph_nodes(struct ubifs_info *c, int atomic) | /* This function writes orphan nodes for all the orphans to commit. On success, %0 is returned, otherwise a negative error code is returned. */
static int write_orph_nodes(struct ubifs_info *c, int atomic) | {
int err;
while (c->cmt_orphans > 0) {
err = write_orph_node(c, atomic);
if (err)
return err;
}
if (atomic) {
int lnum;
for (lnum = c->ohead_lnum + 1; lnum <= c->orph_last; lnum++) {
err = ubifs_leb_unmap(c, lnum);
if (err)
return err;
}
}
return 0;
} | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* Parse the bus-range controlled by this host-pci node. */ | STATIC EFI_STATUS EFIAPI PopulateBusRange(IN CONST VOID *Fdt, IN INT32 HostPciNode, IN OUT PCI_PARSER_TABLE *PciInfo) | /* Parse the bus-range controlled by this host-pci node. */
STATIC EFI_STATUS EFIAPI PopulateBusRange(IN CONST VOID *Fdt, IN INT32 HostPciNode, IN OUT PCI_PARSER_TABLE *PciInfo) | {
CONST UINT8 *Data;
INT32 DataSize;
UINT32 StartBus;
UINT32 EndBus;
if ((Fdt == NULL) ||
(PciInfo == NULL))
{
ASSERT (0);
return EFI_INVALID_PARAMETER;
}
Data = fdt_getprop (Fdt, HostPciNode, "bus-range", &DataSize);
if ((Data == NULL) || (DataSize < 0)) {
StartBus = 0;
EndBus = 255;
} else if (DataSize == (2 * sizeof (UINT32))) {
StartBus = fdt32_to_cpu (((UINT32 *)Data)[0]);
EndBus = fdt32_to_cpu (((UINT32 *)Data)[1]);
} else {
ASSERT (0);
return EFI_ABORTED;
}
PciInfo->PciConfigSpaceInfo.StartBusNumber = StartBus;
PciInfo->PciConfigSpaceInfo.EndBusNumber = EndBus;
return EFI_SUCCESS;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Helper function for getting supported controls directly from the feature unit descriptor. */ | static uint16_t get_controls(const struct feature_unit_descriptor *fu) | /* Helper function for getting supported controls directly from the feature unit descriptor. */
static uint16_t get_controls(const struct feature_unit_descriptor *fu) | {
return sys_get_le16((uint8_t *)&fu->bmaControls[0]);
} | zephyrproject-rtos/zephyr | C++ | Apache License 2.0 | 9,573 |
/* A pointer to the client with the incremented reference counter is returned. */ | struct i2c_client* i2c_use_client(struct i2c_client *client) | /* A pointer to the client with the incremented reference counter is returned. */
struct i2c_client* i2c_use_client(struct i2c_client *client) | {
if (client && get_device(&client->dev))
return client;
return NULL;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Generic i2c probe concerning the addresses: i2c wants 7 bit (without the r/w bit), so '>>1' */ | static int vp27smpx_probe(struct i2c_client *client, const struct i2c_device_id *id) | /* Generic i2c probe concerning the addresses: i2c wants 7 bit (without the r/w bit), so '>>1' */
static int vp27smpx_probe(struct i2c_client *client, const struct i2c_device_id *id) | {
struct vp27smpx_state *state;
struct v4l2_subdev *sd;
if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
return -EIO;
v4l_info(client, "chip found @ 0x%x (%s)\n",
client->addr << 1, client->adapter->name);
state = kzalloc(sizeof(struct vp27smpx_state), GFP_KERNEL);
if (state == NULL)
return -ENOMEM;
sd = &state->sd;
v4l2_i2c_subdev_init(sd, client, &vp27smpx_ops);
state->audmode = V4L2_TUNER_MODE_STEREO;
vp27smpx_set_audmode(sd, state->audmode);
return 0;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* param base HSCMP peripheral base address. param positiveChannel Positive side input channel number. Available range is 0-7. param negativeChannel Negative side input channel number. Available range is 0-7. */ | void HSCMP_SetInputChannels(HSCMP_Type *base, uint32_t positiveChannel, uint32_t negativeChannel) | /* param base HSCMP peripheral base address. param positiveChannel Positive side input channel number. Available range is 0-7. param negativeChannel Negative side input channel number. Available range is 0-7. */
void HSCMP_SetInputChannels(HSCMP_Type *base, uint32_t positiveChannel, uint32_t negativeChannel) | {
uint32_t tmp32;
tmp32 = base->CCR2 & ~(HSCMP_CCR2_PSEL_MASK | HSCMP_CCR2_MSEL_MASK);
tmp32 |= HSCMP_CCR2_PSEL(positiveChannel) | HSCMP_CCR2_MSEL(negativeChannel);
base->CCR2 = tmp32;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* remap the linear value (0-8) to the actual value (0-15) */ | static int vx_compute_mic_level(int level) | /* remap the linear value (0-8) to the actual value (0-15) */
static int vx_compute_mic_level(int level) | {
switch (level) {
case 5: level = 6 ; break;
case 6: level = 8 ; break;
case 7: level = 11; break;
case 8: level = 15; break;
default: break ;
}
return level;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Called when the driver needs to transmit a frame */ | sl_status_t sl_wfx_host_transmit_frame(void *frame, uint32_t frame_len) | /* Called when the driver needs to transmit a frame */
sl_status_t sl_wfx_host_transmit_frame(void *frame, uint32_t frame_len) | {
return sl_wfx_data_write(frame, frame_len);
} | eclipse-threadx/getting-started | C++ | Other | 310 |
/* Checks whether the FLASH SMPSEL is SMP1 or SMP2. */ | FLASH_SMPSEL FLASH_GetSMPSELStatus(void) | /* Checks whether the FLASH SMPSEL is SMP1 or SMP2. */
FLASH_SMPSEL FLASH_GetSMPSELStatus(void) | {
FLASH_SMPSEL bitstatus = FLASH_SMP1;
if ((FLASH->CTRL & CTRL_Reset_SMPSEL) != (uint32_t)FLASH_SMP1)
{
bitstatus = FLASH_SMP2;
}
else
{
bitstatus = FLASH_SMP1;
}
return bitstatus;
} | pikasTech/PikaPython | C++ | MIT License | 1,403 |
/* This function detects if OVMF is running on Xen. */ | BOOLEAN EFIAPI XenDetected(VOID) | /* This function detects if OVMF is running on Xen. */
BOOLEAN EFIAPI XenDetected(VOID) | {
return (XenGetInfoHOB () != NULL);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Locking Note: This function expects that the disc_mutex is locked before it is called. On failure, an error code is returned. */ | static int fc_disc_gpn_id_req(struct fc_lport *lport, struct fc_rport_priv *rdata) | /* Locking Note: This function expects that the disc_mutex is locked before it is called. On failure, an error code is returned. */
static int fc_disc_gpn_id_req(struct fc_lport *lport, struct fc_rport_priv *rdata) | {
struct fc_frame *fp;
fp = fc_frame_alloc(lport, sizeof(struct fc_ct_hdr) +
sizeof(struct fc_ns_fid));
if (!fp)
return -ENOMEM;
if (!lport->tt.elsct_send(lport, rdata->ids.port_id, fp, FC_NS_GPN_ID,
fc_disc_gpn_id_resp, rdata,
3 * lport->r_a_tov))
return -ENOMEM;
kref_get(&rdata->kref);
return 0;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Called very early, MMU is off, device-tree isn't unflattened */ | static int __init mpc837x_mds_probe(void) | /* Called very early, MMU is off, device-tree isn't unflattened */
static int __init mpc837x_mds_probe(void) | {
unsigned long root = of_get_flat_dt_root();
return of_flat_dt_is_compatible(root, "fsl,mpc837xmds");
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Note: the fifo function can be used to exchange data between the main task and interrupts: */ | Ifx_Fifo* Ifx_Fifo_create(Ifx_SizeT size, Ifx_SizeT elementSize) | /* Note: the fifo function can be used to exchange data between the main task and interrupts: */
Ifx_Fifo* Ifx_Fifo_create(Ifx_SizeT size, Ifx_SizeT elementSize) | {
Ifx_Fifo *fifo = NULL_PTR;
size = Ifx_AlignOn32(size);
fifo = malloc(size + sizeof(Ifx_Fifo) + 8);
if (IFX_VALIDATE(IFX_VERBOSE_LEVEL_ERROR, (fifo != NULL_PTR)))
{
fifo = Ifx_Fifo_init(fifo, size, elementSize);
}
return fifo;
} | pikasTech/PikaPython | C++ | MIT License | 1,403 |
/* SYSCTRL GPIOD Bus Clock Disable and Reset Assert. */ | void LL_SYSCTRL_GPIOD_ClkDisRstAssert(void) | /* SYSCTRL GPIOD Bus Clock Disable and Reset Assert. */
void LL_SYSCTRL_GPIOD_ClkDisRstAssert(void) | {
__LL_SYSCTRL_CTRLReg_Unlock(SYSCTRL);
__LL_SYSCTRL_GPIODBusClk_Dis(SYSCTRL);
__LL_SYSCTRL_GPIODSoftRst_Assert(SYSCTRL);
__LL_SYSCTRL_Reg_Lock(SYSCTRL);
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.