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
/* This function is used to add another level to an IO page table. Adding another level increases the size of the address space by 9 bits to a size up to 64 bits. */
static bool increase_address_space(struct protection_domain *domain, gfp_t gfp)
/* This function is used to add another level to an IO page table. Adding another level increases the size of the address space by 9 bits to a size up to 64 bits. */ static bool increase_address_space(struct protection_domain *domain, gfp_t gfp)
{ u64 *pte; if (domain->mode == PAGE_MODE_6_LEVEL) return false; pte = (void *)get_zeroed_page(gfp); if (!pte) return false; *pte = PM_LEVEL_PDE(domain->mode, virt_to_phys(domain->pt_root)); domain->pt_root = pte; domain->mode += 1; domain->updated = true; return true; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Message: CloseMultiMediaReceiveChannelMessage Opcode: 0x0136 Type: MediaControl Direction: pbx2dev VarLength: no */
static void handle_CloseMultiMediaReceiveChannelMessage(ptvcursor_t *cursor, packet_info *pinfo _U_)
/* Message: CloseMultiMediaReceiveChannelMessage Opcode: 0x0136 Type: MediaControl Direction: pbx2dev VarLength: no */ static void handle_CloseMultiMediaReceiveChannelMessage(ptvcursor_t *cursor, packet_info *pinfo _U_)
{ ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_passThruPartyID, 4, ENC_LITTLE_ENDIAN); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_portHandlingFlag, 4, ENC_LITTLE_ENDIAN); }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* strlen - Find the length of a string @s: The string to be sized */
size_t strlen(const char *s)
/* strlen - Find the length of a string @s: The string to be sized */ size_t strlen(const char *s)
{ const char *sc; for (sc = s; *sc != '\0'; ++sc); return sc - s; }
robutest/uclinux
C++
GPL-2.0
60
/* Checks whether the specified SDADC interrupt has occurred or not. */
ITStatus SDADC_GetITStatus(SDADC_TypeDef *SDADCx, uint32_t SDADC_IT)
/* Checks whether the specified SDADC interrupt has occurred or not. */ ITStatus SDADC_GetITStatus(SDADC_TypeDef *SDADCx, uint32_t SDADC_IT)
{ ITStatus bitstatus = RESET; uint32_t itstatus = 0, enablestatus = 0; assert_param(IS_SDADC_ALL_PERIPH(SDADCx)); assert_param(IS_SDADC_GET_IT(SDADC_IT)); itstatus = (uint32_t) (SDADC_IT & SDADCx->ISR); enablestatus = (SDADCx->CR1 & (uint32_t)SDADC_IT); if ((itstatus != (uint32_t)RESET) && (enablestatus != (uint32_t)RESET)) { bitstatus = SET; } else { bitstatus = RESET; } return bitstatus; }
avem-labs/Avem
C++
MIT License
1,752
/* Returns the memory region on success, otherwise returns an errno. Note that all DMA addresses should be created via the struct ib_dma_mapping_ops functions (see ipath_dma.c). */
struct ib_mr* ipath_get_dma_mr(struct ib_pd *pd, int acc)
/* Returns the memory region on success, otherwise returns an errno. Note that all DMA addresses should be created via the struct ib_dma_mapping_ops functions (see ipath_dma.c). */ struct ib_mr* ipath_get_dma_mr(struct ib_pd *pd, int acc)
{ struct ipath_mr *mr; struct ib_mr *ret; mr = kzalloc(sizeof *mr, GFP_KERNEL); if (!mr) { ret = ERR_PTR(-ENOMEM); goto bail; } mr->mr.access_flags = acc; ret = &mr->ibmr; bail: return ret; }
robutest/uclinux
C++
GPL-2.0
60
/* USBD_MTP_Itf_Create_NewObject Create new object in SD card and store necessary information for future use. */
static uint16_t USBD_MTP_Itf_Create_NewObject(MTP_ObjectInfoTypeDef ObjectInfo, uint32_t objhandle)
/* USBD_MTP_Itf_Create_NewObject Create new object in SD card and store necessary information for future use. */ static uint16_t USBD_MTP_Itf_Create_NewObject(MTP_ObjectInfoTypeDef ObjectInfo, uint32_t objhandle)
{ uint16_t rep_code = 0U; UNUSED(ObjectInfo); UNUSED(objhandle); return rep_code; }
STMicroelectronics/STM32CubeF4
C++
Other
789
/* When cap bits have been already read, this doesn't read again but returns the cached value. */
u32 snd_hda_query_pin_caps(struct hda_codec *codec, hda_nid_t nid)
/* When cap bits have been already read, this doesn't read again but returns the cached value. */ u32 snd_hda_query_pin_caps(struct hda_codec *codec, hda_nid_t nid)
{ return query_caps_hash(codec, nid, HDA_HASH_PINCAP_KEY(nid), read_pin_cap); }
robutest/uclinux
C++
GPL-2.0
60
/* This function returns the size of the EEPROM in bytes. */
uint32_t EEPROMSizeGet(void)
/* This function returns the size of the EEPROM in bytes. */ uint32_t EEPROMSizeGet(void)
{ return(SIZE_FROM_EESIZE(HWREG(EEPROM_EESIZE))); }
feaser/openblt
C++
GNU General Public License v3.0
601
/* Sets up the periodic ISR used for the RTOS tick. */
static void prvSetupTimerInterrupt(void)
/* Sets up the periodic ISR used for the RTOS tick. */ static void prvSetupTimerInterrupt(void)
{ TAU0EN = 1; TT0 = 0xff; TMMK05 = 1; TMIF05 = 0; TMPR005 = 0; TMPR105 = 0; TMR05 = 0x0000; TDR05 = ( TickType_t ) ( configCPU_CLOCK_HZ / configTICK_RATE_HZ ); TOM0 &= ~0x0020; TOL0 &= ~0x0020; TOE0 &= ~0x0020; TMMK05 = 0; TS0 |= 0x0020; }
labapart/polymcu
C++
null
201
/* Handler for RM9000 extended interrupts. These are a non-standard feature so we handle them separately from standard interrupts. */
static void unmask_rm9k_irq(unsigned int irq)
/* Handler for RM9000 extended interrupts. These are a non-standard feature so we handle them separately from standard interrupts. */ static void unmask_rm9k_irq(unsigned int irq)
{ set_c0_intcontrol(0x1000 << (irq - RM9K_CPU_IRQ_BASE)); }
EmcraftSystems/linux-emcraft
C++
Other
266
/* This routine ensures that the EDAC memory controller reporting method is mapped to a sane value as the EDAC core defines the value to EDAC_OPSTATE_INVAL by default. We don't call the global opstate_init as that defaults to polling and we want interrupt as the default. */
static void __init ppc4xx_edac_opstate_init(void)
/* This routine ensures that the EDAC memory controller reporting method is mapped to a sane value as the EDAC core defines the value to EDAC_OPSTATE_INVAL by default. We don't call the global opstate_init as that defaults to polling and we want interrupt as the default. */ static void __init ppc4xx_edac_opstate_init(void)
{ switch (edac_op_state) { case EDAC_OPSTATE_POLL: case EDAC_OPSTATE_INT: break; default: edac_op_state = EDAC_OPSTATE_INT; break; } ppc4xx_edac_printk(KERN_INFO, "Reporting type: %s\n", ((edac_op_state == EDAC_OPSTATE_POLL) ? EDAC_OPSTATE_POLL_STR : ((edac_op_state == EDAC_OPSTATE_INT) ? EDAC_OPSTATE_INT_STR : EDAC_OPSTATE_UNKNOWN_STR))); }
robutest/uclinux
C++
GPL-2.0
60
/* The clock_cpu_microsecond() fucntion shall return the millisecond according to cpu_tick parameter. */
uint64_t clock_cpu_millisecond(uint64_t cpu_tick)
/* The clock_cpu_microsecond() fucntion shall return the millisecond according to cpu_tick parameter. */ uint64_t clock_cpu_millisecond(uint64_t cpu_tick)
{ uint64_t unit = clock_cpu_getres(); return (uint64_t)(((cpu_tick * unit) / (1000UL * 1000)) / (1000UL * 1000)); }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* inout : decides on the direction of the dataflow and the meaning of the variables buffer: If inout==FALSE data is being written to it else read from it *start: If inout==FALSE start of the valid data in the buffer offset: If inout==FALSE offset from the beginning of the imaginary file from which we start writing into the buffer length: If inout==FALSE max number of bytes to be written into the buffer else number of bytes in the buffer */
static int fd_mcs_proc_info(struct Scsi_Host *shpnt, char *buffer, char **start, off_t offset, int length, int inout)
/* inout : decides on the direction of the dataflow and the meaning of the variables buffer: If inout==FALSE data is being written to it else read from it *start: If inout==FALSE start of the valid data in the buffer offset: If inout==FALSE offset from the beginning of the imaginary file from which we start writing into the buffer length: If inout==FALSE max number of bytes to be written into the buffer else number of bytes in the buffer */ static int fd_mcs_proc_info(struct Scsi_Host *shpnt, char *buffer, char **start, off_t offset, int length, int inout)
{ int len = 0; if (inout) return (-ENOSYS); *start = buffer + offset; len += sprintf(buffer + len, "Future Domain MCS-600/700 Driver %s\n", DRIVER_VERSION); len += sprintf(buffer + len, "HOST #%d: %s\n", shpnt->host_no, adapter_name); len += sprintf(buffer + len, "FIFO Size=0x%x, FIFO Count=%d\n", FIFO_Size, FIFO_COUNT); len += sprintf(buffer + len, "DriverCalls=%d, Interrupts=%d, BytesRead=%d, BytesWrite=%d\n\n", TOTAL_INTR, INTR_Processed, Bytes_Read, Bytes_Written); if ((len -= offset) <= 0) return 0; if (len > length) len = length; return len; }
robutest/uclinux
C++
GPL-2.0
60
/* Gets interrupt status for the specified ADC module. */
uint32_t ADCIntStatusEx(uint32_t ui32Base, bool bMasked)
/* Gets interrupt status for the specified ADC module. */ uint32_t ADCIntStatusEx(uint32_t ui32Base, bool bMasked)
{ uint32_t ui32Temp; ASSERT((ui32Base == ADC0_BASE) || (ui32Base == ADC1_BASE)); if (bMasked) { ui32Temp = HWREG(ui32Base + ADC_O_ISC); } else { ui32Temp = HWREG(ui32Base + ADC_O_RIS); if (ui32Temp & ADC_RIS_INRDC) { ui32Temp |= (ADC_INT_DCON_SS3 | ADC_INT_DCON_SS2 | ADC_INT_DCON_SS1 | ADC_INT_DCON_SS0); } } return (ui32Temp); }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* This is a helper function which initializes various UBIFS constants after the master node has been read. It also checks various UBIFS parameters and makes sure they are all right. */
static void init_constants_master(struct ubifs_info *c)
/* This is a helper function which initializes various UBIFS constants after the master node has been read. It also checks various UBIFS parameters and makes sure they are all right. */ static void init_constants_master(struct ubifs_info *c)
{ long long tmp64; c->min_idx_lebs = ubifs_calc_min_idx_lebs(c); c->report_rp_size = ubifs_reported_space(c, c->rp_size); tmp64 = c->main_lebs - 1 - 1 - MIN_INDEX_LEBS - c->jhead_cnt + 1; tmp64 *= (long long)c->leb_size - c->leb_overhead; tmp64 = ubifs_reported_space(c, tmp64); c->block_cnt = tmp64 >> UBIFS_BLOCK_SHIFT; }
robutest/uclinux
C++
GPL-2.0
60
/* RETURNS: ATA_DEFER_* if deferring is needed, 0 otherwise. */
int ata_std_qc_defer(struct ata_queued_cmd *qc)
/* RETURNS: ATA_DEFER_* if deferring is needed, 0 otherwise. */ int ata_std_qc_defer(struct ata_queued_cmd *qc)
{ struct ata_link *link = qc->dev->link; if (qc->tf.protocol == ATA_PROT_NCQ) { if (!ata_tag_valid(link->active_tag)) return 0; } else { if (!ata_tag_valid(link->active_tag) && !link->sactive) return 0; } return ATA_DEFER_LINK; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* USBH_TEMPLATE_ClassRequest The function is responsible for handling Standard requests for TEMPLATE class. */
static USBH_StatusTypeDef USBH_TEMPLATE_ClassRequest(USBH_HandleTypeDef *phost)
/* USBH_TEMPLATE_ClassRequest The function is responsible for handling Standard requests for TEMPLATE class. */ static USBH_StatusTypeDef USBH_TEMPLATE_ClassRequest(USBH_HandleTypeDef *phost)
{ UNUSED(phost); return USBH_OK; }
STMicroelectronics/STM32CubeF4
C++
Other
789
/* Reads the specified SPI CRC Polynomial register value. */
uint16_t SPI_ReadCRCPolynomial(SPI_T *spi)
/* Reads the specified SPI CRC Polynomial register value. */ uint16_t SPI_ReadCRCPolynomial(SPI_T *spi)
{ return spi->CRCPOLY_B.CRCPOLY; }
pikasTech/PikaPython
C++
MIT License
1,403
/* return ret; } static int r8180_wx_set_psmode(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { struct r8180_priv *priv = ieee80211_priv(dev); struct ieee80211_device *ieee; int ret = 0; */
static int r8180_wx_get_iwmode(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra)
/* return ret; } static int r8180_wx_set_psmode(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { struct r8180_priv *priv = ieee80211_priv(dev); struct ieee80211_device *ieee; int ret = 0; */ static int r8180_wx_get_iwmode(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra)
{ struct r8180_priv *priv = ieee80211_priv(dev); struct ieee80211_device *ieee; int ret = 0; down(&priv->wx_sem); ieee = priv->ieee80211; strcpy(extra, "802.11"); if(ieee->modulation & IEEE80211_CCK_MODULATION) { strcat(extra, "b"); if(ieee->modulation & IEEE80211_OFDM_MODULATION) strcat(extra, "/g"); } else if(ieee->modulation & IEEE80211_OFDM_MODULATION) strcat(extra, "g"); up(&priv->wx_sem); return ret; }
robutest/uclinux
C++
GPL-2.0
60
/* ZigBee ZCL Shade Configuration cluster dissector for wireshark. */
static int dissect_zbee_zcl_shade_configuration(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_)
/* ZigBee ZCL Shade Configuration cluster dissector for wireshark. */ static int dissect_zbee_zcl_shade_configuration(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_)
{ return tvb_captured_length(tvb); }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* Perform INTx swizzling for a device. This traverses through all PCI-to-PCI bridges all the way up to a PCI root bus. */
u8 pci_common_swizzle(struct pci_dev *dev, u8 *pinp)
/* Perform INTx swizzling for a device. This traverses through all PCI-to-PCI bridges all the way up to a PCI root bus. */ u8 pci_common_swizzle(struct pci_dev *dev, u8 *pinp)
{ u8 pin = *pinp; while (!pci_is_root_bus(dev->bus)) { pin = pci_swizzle_interrupt_pin(dev, pin); dev = dev->bus->self; } *pinp = pin; return PCI_SLOT(dev->devfn); }
robutest/uclinux
C++
GPL-2.0
60
/* queuecommand method. Entered with the host adapter lock held and interrupts disabled. */
static int sym53c8xx_queue_command(struct scsi_cmnd *cmd, void(*done)(struct scsi_cmnd *))
/* queuecommand method. Entered with the host adapter lock held and interrupts disabled. */ static int sym53c8xx_queue_command(struct scsi_cmnd *cmd, void(*done)(struct scsi_cmnd *))
{ struct sym_hcb *np = SYM_SOFTC_PTR(cmd); struct sym_ucmd *ucp = SYM_UCMD_PTR(cmd); int sts = 0; cmd->scsi_done = done; memset(ucp, 0, sizeof(*ucp)); if (np->s.settle_time_valid && cmd->request->timeout) { unsigned long tlimit = jiffies + cmd->request->timeout; tlimit -= SYM_CONF_TIMER_INTERVAL*2; if (time_after(np->s.settle_time, tlimit)) { np->s.settle_time = tlimit; } } if (np->s.settle_time_valid) return SCSI_MLQUEUE_HOST_BUSY; sts = sym_queue_command(np, cmd); if (sts) return SCSI_MLQUEUE_HOST_BUSY; return 0; }
robutest/uclinux
C++
GPL-2.0
60
/* Returns: 1 if region filled, 0 if no work, <0 on error */
static int userspace_get_resync_work(struct dm_dirty_log *log, region_t *region)
/* Returns: 1 if region filled, 0 if no work, <0 on error */ static int userspace_get_resync_work(struct dm_dirty_log *log, region_t *region)
{ int r; size_t rdata_size; struct log_c *lc = log->context; struct { int64_t i; region_t r; } pkg; if (lc->in_sync_hint >= lc->region_count) return 0; rdata_size = sizeof(pkg); r = userspace_do_request(lc, lc->uuid, DM_ULOG_GET_RESYNC_WORK, NULL, 0, (char *)&pkg, &rdata_size); *region = pkg.r; return (r) ? r : (int)pkg.i; }
robutest/uclinux
C++
GPL-2.0
60
/* This routine is called, for example, when the rmmod command is executed. The device may or may not be electrically present. If it is present, the driver stops device processing. Any resources used on behalf of this device are freed. */
static int dwc2_driver_remove(struct platform_device *dev)
/* This routine is called, for example, when the rmmod command is executed. The device may or may not be electrically present. If it is present, the driver stops device processing. Any resources used on behalf of this device are freed. */ static int dwc2_driver_remove(struct platform_device *dev)
{ struct dwc2_hsotg *hsotg = platform_get_drvdata(dev); dwc2_hcd_remove(hsotg); return 0; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* If @urb was unlinked, the value of @status will be overridden by @urb->unlinked. Erroneous short transfers are detected in case the HCD hasn't checked for them. */
void usb_hcd_giveback_urb(struct usb_hcd *hcd, struct urb *urb, int status)
/* If @urb was unlinked, the value of @status will be overridden by @urb->unlinked. Erroneous short transfers are detected in case the HCD hasn't checked for them. */ void usb_hcd_giveback_urb(struct usb_hcd *hcd, struct urb *urb, int status)
{ urb->hcpriv = NULL; if (unlikely(urb->unlinked)) status = urb->unlinked; else if (unlikely((urb->transfer_flags & URB_SHORT_NOT_OK) && urb->actual_length < urb->transfer_buffer_length && !status)) status = -EREMOTEIO; unmap_urb_for_dma(hcd, urb); usbmon_urb_complete(&hcd->self, urb, status); usb_unanchor_urb(urb); urb->status = status; urb->complete (urb); atomic_dec (&urb->use_count); if (unlikely(atomic_read(&urb->reject))) wake_up (&usb_kill_urb_queue); usb_put_urb (urb); }
robutest/uclinux
C++
GPL-2.0
60
/* Close a ZipFile opened with unzipOpen. If there is files inside the .Zip opened with unzipOpenCurrentFile (see later), these files MUST be closed with unzipCloseCurrentFile before call unzipClose. return UNZ_OK if there is no problem. */
int ZEXPORT unzClose(unzFile file)
/* Close a ZipFile opened with unzipOpen. If there is files inside the .Zip opened with unzipOpenCurrentFile (see later), these files MUST be closed with unzipCloseCurrentFile before call unzipClose. return UNZ_OK if there is no problem. */ int ZEXPORT unzClose(unzFile file)
{ unz_s* s; ZIPFILE *pzf; if (file==NULL) return UNZ_PARAMERROR; s=(unz_s*)file; pzf = s->zfile; if (s->pfile_in_zip_read!=NULL) unzCloseCurrentFile(file); if (pzf->pfnClose != NULL) (*pzf->pfnClose)(pzf); return UNZ_OK; }
ua1arn/hftrx
C++
null
69
/* Write a byte to the given I2C instance. */
void _i2c_s_async_write_byte(struct _i2c_s_async_device *const device, const uint8_t data)
/* Write a byte to the given I2C instance. */ void _i2c_s_async_write_byte(struct _i2c_s_async_device *const device, const uint8_t data)
{ hri_sercomi2cs_write_DATA_reg(device->hw, data); }
eclipse-threadx/getting-started
C++
Other
310
/* The SDRAM hardware has been configured by the first stage boot loader. We only need to announce its size, using u-boot's memory check. */
int dram_init(void)
/* The SDRAM hardware has been configured by the first stage boot loader. We only need to announce its size, using u-boot's memory check. */ int dram_init(void)
{ gd->ram_size = get_ram_size( (void *)CONFIG_SYS_SDRAM_BASE, CONFIG_SYS_SDRAM_SIZE); return 0; }
4ms/stm32mp1-baremetal
C++
Other
137
/* Clone a &bio. Caller will own the returned bio, but not the actual data it points to. Reference count of returned bio will be one. */
void __bio_clone(struct bio *bio, struct bio *bio_src)
/* Clone a &bio. Caller will own the returned bio, but not the actual data it points to. Reference count of returned bio will be one. */ void __bio_clone(struct bio *bio, struct bio *bio_src)
{ memcpy(bio->bi_io_vec, bio_src->bi_io_vec, bio_src->bi_max_vecs * sizeof(struct bio_vec)); bio->bi_sector = bio_src->bi_sector; bio->bi_bdev = bio_src->bi_bdev; bio->bi_flags |= 1 << BIO_CLONED; bio->bi_rw = bio_src->bi_rw; bio->bi_vcnt = bio_src->bi_vcnt; bio->bi_size = bio_src->bi_size; bio->bi_idx = bio_src->bi_idx; }
robutest/uclinux
C++
GPL-2.0
60
/* Common USART2 TX interrupt handler. This function handles USART2 TX complete interrupt request */
void USART2_TX_IRQHandler(void)
/* Common USART2 TX interrupt handler. This function handles USART2 TX complete interrupt request */ void USART2_TX_IRQHandler(void)
{ rt_interrupt_enter(); if (USART2->IF & USART_IF_TXC) { if (usartCbTable[4].cbFunc != RT_NULL) { (usartCbTable[4].cbFunc)(usartCbTable[4].userPtr); } BITBAND_Peripheral(&(USART2->IFC), _USART_IF_TXC_SHIFT, 0x1UL); } rt_interrupt_leave(); }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Fair output driver allows a process to speak. */
static void rs_fair_output(void)
/* Fair output driver allows a process to speak. */ static void rs_fair_output(void)
{ int left; unsigned long flags; struct m68k_serial *info = &m68k_soft[0]; char c; if (info == 0) return; if (info->xmit_buf == 0) return; local_irq_save(flags); left = info->xmit_cnt; while (left != 0) { c = info->xmit_buf[info->xmit_tail]; info->xmit_tail = (info->xmit_tail+1) & (SERIAL_XMIT_SIZE-1); info->xmit_cnt--; local_irq_restore(flags); rs_put_char(c); local_irq_save(flags); left = min(info->xmit_cnt, left-1); } udelay(5); local_irq_restore(flags); return; }
robutest/uclinux
C++
GPL-2.0
60
/* Check if another callback has registered the same temperature. */
static bool checkForDuplicates(TEMPDRV_CallbackSet_t *set, int8_t temp)
/* Check if another callback has registered the same temperature. */ static bool checkForDuplicates(TEMPDRV_CallbackSet_t *set, int8_t temp)
{ uint8_t index; uint8_t emu = convertToEmu(temp); for (index = TEMPDRV_CUSTOM_CALLBACK_INDEX; index < TEMPDRV_CALLBACK_DEPTH; index++) { if (set[index].callback!=NULL) { if (set[index].temp == emu) { return true; } } } return false; }
remotemcu/remcu-chip-sdks
C++
null
436
/* Get string from HII database in English language. The returned string is allocated using AllocatePool(). The caller is responsible for freeing the allocated buffer using FreePool(). */
EFI_STRING HiiGetEnglishString(IN EFI_HII_HANDLE HiiHandle, IN EFI_STRING_ID StringId)
/* Get string from HII database in English language. The returned string is allocated using AllocatePool(). The caller is responsible for freeing the allocated buffer using FreePool(). */ EFI_STRING HiiGetEnglishString(IN EFI_HII_HANDLE HiiHandle, IN EFI_STRING_ID StringId)
{ return HiiGetRedfishString (HiiHandle, ENGLISH_LANGUAGE_CODE, StringId); }
tianocore/edk2
C++
Other
4,240
/* The WSSID hash for a WSSID is the result of an octet-wise exclusive-OR of all octets in the WSSID. */
static u8 wlp_wss_comp_wssid_hash(struct wlp_uuid *wssid)
/* The WSSID hash for a WSSID is the result of an octet-wise exclusive-OR of all octets in the WSSID. */ static u8 wlp_wss_comp_wssid_hash(struct wlp_uuid *wssid)
{ return wssid->data[0] ^ wssid->data[1] ^ wssid->data[2] ^ wssid->data[3] ^ wssid->data[4] ^ wssid->data[5] ^ wssid->data[6] ^ wssid->data[7] ^ wssid->data[8] ^ wssid->data[9] ^ wssid->data[10] ^ wssid->data[11] ^ wssid->data[12] ^ wssid->data[13] ^ wssid->data[14] ^ wssid->data[15]; }
robutest/uclinux
C++
GPL-2.0
60
/* scsi_remove_device - unregister a device from the scsi bus @sdev: scsi_device to unregister */
void scsi_remove_device(struct scsi_device *sdev)
/* scsi_remove_device - unregister a device from the scsi bus @sdev: scsi_device to unregister */ void scsi_remove_device(struct scsi_device *sdev)
{ struct Scsi_Host *shost = sdev->host; mutex_lock(&shost->scan_mutex); __scsi_remove_device(sdev); mutex_unlock(&shost->scan_mutex); }
robutest/uclinux
C++
GPL-2.0
60
/* Interrupt handler for the RTT. Display the current time on the terminal. */
void RTT_Handler(void)
/* Interrupt handler for the RTT. Display the current time on the terminal. */ void RTT_Handler(void)
{ uint32_t ul_status; ul_status = rtt_get_status(RTT); if ((ul_status & RTT_SR_RTTINC) == RTT_SR_RTTINC) { refresh_display(); } if ((ul_status & RTT_SR_ALMS) == RTT_SR_ALMS) { g_uc_alarmed = 1; refresh_display(); } }
remotemcu/remcu-chip-sdks
C++
null
436
/* Returns 0 if current can read the object task, error code otherwise */
static int smack_task_getpgid(struct task_struct *p)
/* Returns 0 if current can read the object task, error code otherwise */ static int smack_task_getpgid(struct task_struct *p)
{ return smk_curacc_on_task(p, MAY_READ); }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Get Standby Flag. The standby flag is set when the processor returns from a standby state. It is cleared by software (see */
bool pwr_get_standby_flag(void)
/* Get Standby Flag. The standby flag is set when the processor returns from a standby state. It is cleared by software (see */ bool pwr_get_standby_flag(void)
{ return PWR_CSR & PWR_CSR_SBF; }
insane-adding-machines/unicore-mx
C++
GNU General Public License v3.0
50
/* Gets the enabled attributes of a uDMA channel. */
uint32_t uDMAChannelAttributeGet(uint32_t ui32ChannelNum)
/* Gets the enabled attributes of a uDMA channel. */ uint32_t uDMAChannelAttributeGet(uint32_t ui32ChannelNum)
{ uint32_t ui32Attr = 0; ASSERT((ui32ChannelNum & 0xffff) < 32); ui32ChannelNum &= 0x1f; if (HWREG(UDMA_USEBURSTSET) & (1 << ui32ChannelNum)) { ui32Attr |= UDMA_ATTR_USEBURST; } if (HWREG(UDMA_ALTSET) & (1 << ui32ChannelNum)) { ui32Attr |= UDMA_ATTR_ALTSELECT; } if (HWREG(UDMA_PRIOSET) & (1 << ui32ChannelNum)) { ui32Attr |= UDMA_ATTR_HIGH_PRIORITY; } if (HWREG(UDMA_REQMASKSET) & (1 << ui32ChannelNum)) { ui32Attr |= UDMA_ATTR_REQMASK; } return (ui32Attr); }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* dcache operations Note: the dentry argument is the parent dentry. */
static int hpfs_hash_dentry(struct dentry *dentry, struct qstr *qstr)
/* dcache operations Note: the dentry argument is the parent dentry. */ static int hpfs_hash_dentry(struct dentry *dentry, struct qstr *qstr)
{ unsigned long hash; int i; unsigned l = qstr->len; if (l == 1) if (qstr->name[0]=='.') goto x; if (l == 2) if (qstr->name[0]=='.' || qstr->name[1]=='.') goto x; hpfs_adjust_length((char *)qstr->name, &l); x: hash = init_name_hash(); for (i = 0; i < l; i++) hash = partial_name_hash(hpfs_upcase(hpfs_sb(dentry->d_sb)->sb_cp_table,qstr->name[i]), hash); qstr->hash = end_name_hash(hash); return 0; }
robutest/uclinux
C++
GPL-2.0
60
/* Waits for the SPI flash to indicate that it is ready (not busy) or until a timeout occurs. */
spiflashError_e w25q16bvWaitForReady()
/* Waits for the SPI flash to indicate that it is ready (not busy) or until a timeout occurs. */ spiflashError_e w25q16bvWaitForReady()
{ uint32_t timeout = 0; uint8_t status; while ( timeout < SSP_MAX_TIMEOUT ) { status = w25q16bvGetStatus() & W25Q16BV_STAT1_BUSY; if (status == 0) { break; } timeout++; } if ( timeout == SSP_MAX_TIMEOUT ) { return SPIFLASH_ERROR_TIMEOUT_READY; } return SPIFLASH_ERROR_OK; }
microbuilder/LPC1343CodeBase
C++
Other
73
/* Writes the I/O port specified by Port with registers width and value specified by Width and Data respectively. Data is returned. If such operations are not supported, then ASSERT(). This function must guarantee that all I/O read and write operations are serialized. */
UINT64 EFIAPI IoWriteWorker(IN UINTN Port, IN EFI_SMM_IO_WIDTH Width, IN UINT64 Data)
/* Writes the I/O port specified by Port with registers width and value specified by Width and Data respectively. Data is returned. If such operations are not supported, then ASSERT(). This function must guarantee that all I/O read and write operations are serialized. */ UINT64 EFIAPI IoWriteWorker(IN UINTN Port, IN EFI_SMM_IO_WIDTH Width, IN UINT64 Data)
{ EFI_STATUS Status; Status = gSmst->SmmIo.Io.Write (&gSmst->SmmIo, Width, Port, 1, &Data); ASSERT_EFI_ERROR (Status); return Data; }
tianocore/edk2
C++
Other
4,240
/* Add an entry to the event buffer. When we get near to the end we wake up the process sleeping on the read() of the file. To protect the event_buffer this function may only be called when buffer_mutex is set. */
void add_event_entry(unsigned long value)
/* Add an entry to the event buffer. When we get near to the end we wake up the process sleeping on the read() of the file. To protect the event_buffer this function may only be called when buffer_mutex is set. */ void add_event_entry(unsigned long value)
{ if (!event_buffer) { WARN_ON_ONCE(1); return; } if (buffer_pos == buffer_size) { atomic_inc(&oprofile_stats.event_lost_overflow); return; } event_buffer[buffer_pos] = value; if (++buffer_pos == buffer_size - buffer_watershed) { atomic_set(&buffer_ready, 1); wake_up(&buffer_wait); } }
robutest/uclinux
C++
GPL-2.0
60
/* Enable port-specific (i.e., MAC and PHY) interrupts for the given adapter port. */
void t3_port_intr_enable(struct adapter *adapter, int idx)
/* Enable port-specific (i.e., MAC and PHY) interrupts for the given adapter port. */ void t3_port_intr_enable(struct adapter *adapter, int idx)
{ struct cphy *phy = &adap2pinfo(adapter, idx)->phy; t3_write_reg(adapter, XGM_REG(A_XGM_INT_ENABLE, idx), XGM_INTR_MASK); t3_read_reg(adapter, XGM_REG(A_XGM_INT_ENABLE, idx)); phy->ops->intr_enable(phy); }
robutest/uclinux
C++
GPL-2.0
60
/* Ooo, nasty. We need here to frob 32-bit unsigned longs to 64-bit unsigned longs. */
static int compat_get_fd_set(unsigned long nr, compat_ulong_t __user *ufdset, unsigned long *fdset)
/* Ooo, nasty. We need here to frob 32-bit unsigned longs to 64-bit unsigned longs. */ static int compat_get_fd_set(unsigned long nr, compat_ulong_t __user *ufdset, unsigned long *fdset)
{ nr = DIV_ROUND_UP(nr, __COMPAT_NFDBITS); if (ufdset) { unsigned long odd; if (!access_ok(VERIFY_WRITE, ufdset, nr*sizeof(compat_ulong_t))) return -EFAULT; odd = nr & 1UL; nr &= ~1UL; while (nr) { unsigned long h, l; if (__get_user(l, ufdset) || __get_user(h, ufdset+1)) return -EFAULT; ufdset += 2; *fdset++ = h << 32 | l; nr -= 2; } if (odd && __get_user(*fdset, ufdset)) return -EFAULT; } else { memset(fdset, 0, ((nr + 1) & ~1)*sizeof(compat_ulong_t)); } return 0; }
robutest/uclinux
C++
GPL-2.0
60
/* Deinitializes the WFE registers to their default reset value. */
void WFE_DeInit(void)
/* Deinitializes the WFE registers to their default reset value. */ void WFE_DeInit(void)
{ WFE->CR1 = WFE_CRX_RESET_VALUE; WFE->CR2 = WFE_CRX_RESET_VALUE; WFE->CR3 = WFE_CRX_RESET_VALUE; WFE->CR4 = WFE_CRX_RESET_VALUE; }
remotemcu/remcu-chip-sdks
C++
null
436
/* SPI MSP De-Initialization This function freeze the hardware resources used in this example. */
void HAL_SPI_MspDeInit(SPI_HandleTypeDef *hspi)
/* SPI MSP De-Initialization This function freeze the hardware resources used in this example. */ void HAL_SPI_MspDeInit(SPI_HandleTypeDef *hspi)
{ if(hspi->Instance==SPI1) { __HAL_RCC_SPI1_CLK_DISABLE(); HAL_GPIO_DeInit(GPIOA, GPIO_PIN_6|GPIO_PIN_7); HAL_GPIO_DeInit(GPIOB, GPIO_PIN_3); } }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Reads and returns the current value of the EFLAGS register. This function is only available on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on X64. */
UINTN EFIAPI AsmReadEflags(VOID)
/* Reads and returns the current value of the EFLAGS register. This function is only available on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on X64. */ UINTN EFIAPI AsmReadEflags(VOID)
{ UINTN Eflags; __asm__ __volatile__ ( "pushfl \n\t" "popl %0 " : "=r" (Eflags) ); return Eflags; }
tianocore/edk2
C++
Other
4,240
/* Description: This function is designed to be used as a callback to the call_rcu() function so that the memory allocated to the DOI definition can be released safely. */
static void cipso_v4_doi_free_rcu(struct rcu_head *entry)
/* Description: This function is designed to be used as a callback to the call_rcu() function so that the memory allocated to the DOI definition can be released safely. */ static void cipso_v4_doi_free_rcu(struct rcu_head *entry)
{ struct cipso_v4_doi *doi_def; doi_def = container_of(entry, struct cipso_v4_doi, rcu); cipso_v4_doi_free(doi_def); }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Return the enabled stimer interrupts. This function will return all enabled interrupts in the STIMER interrupt enable register. */
uint32_t am_hal_stimer_int_enable_get(void)
/* Return the enabled stimer interrupts. This function will return all enabled interrupts in the STIMER interrupt enable register. */ uint32_t am_hal_stimer_int_enable_get(void)
{ return AM_REGn(CTIMER, 0, STMINTEN); }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* This function extends the used data area of the buffer. If this would exceed the total buffer size the kernel will panic. A pointer to the first byte of the extra data is returned. */
unsigned char* skb_put(struct sk_buff *skb, unsigned int len)
/* This function extends the used data area of the buffer. If this would exceed the total buffer size the kernel will panic. A pointer to the first byte of the extra data is returned. */ unsigned char* skb_put(struct sk_buff *skb, unsigned int len)
{ unsigned char *tmp = skb_tail_pointer(skb); SKB_LINEAR_ASSERT(skb); skb->tail += len; skb->len += len; if (unlikely(skb->tail > skb->end)) skb_over_panic(skb, len, __builtin_return_address(0)); return tmp; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* assuming the pin is muxed as a gpio output, set its value. */
int at91_set_pio_value(unsigned port, unsigned pin, int value)
/* assuming the pin is muxed as a gpio output, set its value. */ int at91_set_pio_value(unsigned port, unsigned pin, int value)
{ at91_pio_t *pio = (at91_pio_t *) AT91_PIO_BASE; u32 mask; if ((port < AT91_PIO_PORTS) && (pin < 32)) { mask = 1 << pin; if (value) writel(mask, &pio->port[port].sodr); else writel(mask, &pio->port[port].codr); } return 0; }
EmcraftSystems/u-boot
C++
Other
181
/* GMAC programmed with the back off limit value. */
void synopGMAC_back_off_limit(synopGMACdevice *gmacdev, u32 value)
/* GMAC programmed with the back off limit value. */ void synopGMAC_back_off_limit(synopGMACdevice *gmacdev, u32 value)
{ u32 data; data = synopGMACReadReg(gmacdev -> MacBase, GmacConfig); data &= (~GmacBackoffLimit); data |= value; synopGMACWriteReg(gmacdev -> MacBase, GmacConfig, data); return; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* DAC960_DestroyProcEntries destroys the /proc/rd/... entries for the DAC960 Driver. */
static void DAC960_DestroyProcEntries(DAC960_Controller_T *Controller)
/* DAC960_DestroyProcEntries destroys the /proc/rd/... entries for the DAC960 Driver. */ static void DAC960_DestroyProcEntries(DAC960_Controller_T *Controller)
{ if (Controller->ControllerProcEntry == NULL) return; remove_proc_entry("initial_status", Controller->ControllerProcEntry); remove_proc_entry("current_status", Controller->ControllerProcEntry); remove_proc_entry("user_command", Controller->ControllerProcEntry); remove_proc_entry(Controller->ControllerName, DAC960_ProcDirectoryEntry); Controller->ControllerProcEntry = NULL; }
robutest/uclinux
C++
GPL-2.0
60
/* device_remove_file - remove sysfs attribute file. @dev: device. @attr: device attribute descriptor. */
void device_remove_file(struct device *dev, const struct device_attribute *attr)
/* device_remove_file - remove sysfs attribute file. @dev: device. @attr: device attribute descriptor. */ void device_remove_file(struct device *dev, const struct device_attribute *attr)
{ if (dev) sysfs_remove_file(&dev->kobj, &attr->attr); }
robutest/uclinux
C++
GPL-2.0
60
/* Get Configuration USB Device Request Parameters: None Return Value: TRUE - Success, FALSE - Error */
static BOOL USBD_ReqGetConfiguration(void)
/* Get Configuration USB Device Request Parameters: None Return Value: TRUE - Success, FALSE - Error */ static BOOL USBD_ReqGetConfiguration(void)
{ switch (USBD_SetupPacket.bmRequestType.Recipient) { case REQUEST_TO_DEVICE: USBD_EP0Data.pData = &USBD_Configuration; break; default: return (__FALSE); } return (__TRUE); }
ARMmbed/DAPLink
C++
Apache License 2.0
2,140
/* As long as we aren't using composite TVBs, this saves the cycles used (often unnecessariliy) in allocating a buffer and copying the string into it. (If we do start using composite TVBs, we may want to replace this function with the _ephemeral version.) */
const guint8* tvb_get_const_stringz(tvbuff_t *tvb, const gint offset, gint *lengthp)
/* As long as we aren't using composite TVBs, this saves the cycles used (often unnecessariliy) in allocating a buffer and copying the string into it. (If we do start using composite TVBs, we may want to replace this function with the _ephemeral version.) */ const guint8* tvb_get_const_stringz(tvbuff_t *tvb, const gint offset, gint *lengthp)
{ guint size; const guint8 *strptr; size = tvb_strsize(tvb, offset); strptr = ensure_contiguous(tvb, offset, size); if (lengthp) *lengthp = size; return strptr; }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* @cmd: Named device to erase @response: Pointer to fastboot response buffer */
void fastboot_nand_erase(const char *cmd, char *response)
/* @cmd: Named device to erase @response: Pointer to fastboot response buffer */ void fastboot_nand_erase(const char *cmd, char *response)
{ struct part_info *part; struct mtd_info *mtd = NULL; int ret; ret = fb_nand_lookup(cmd, &mtd, &part, response); if (ret) { pr_err("invalid NAND device"); fastboot_fail("invalid NAND device", response); return; } ret = board_fastboot_erase_partition_setup(part->name); if (ret) return; ret = _fb_nand_erase(mtd, part); if (ret) { pr_err("failed erasing from device %s", mtd->name); fastboot_fail("failed erasing from device", response); return; } fastboot_okay(NULL, response); }
4ms/stm32mp1-baremetal
C++
Other
137
/* Return codes PCI_ERS_RESULT_RECOVERED - the device has been recovered PCI_ERS_RESULT_DISCONNECT - device could not be recovered */
static pci_ers_result_t lpfc_io_slot_reset_s4(struct pci_dev *pdev)
/* Return codes PCI_ERS_RESULT_RECOVERED - the device has been recovered PCI_ERS_RESULT_DISCONNECT - device could not be recovered */ static pci_ers_result_t lpfc_io_slot_reset_s4(struct pci_dev *pdev)
{ return PCI_ERS_RESULT_RECOVERED; }
robutest/uclinux
C++
GPL-2.0
60
/* Find an interface whose configured IP address is Ip. */
IP4_INTERFACE* Ip4FindInterface(IN IP4_SERVICE *IpSb, IN IP4_ADDR Ip)
/* Find an interface whose configured IP address is Ip. */ IP4_INTERFACE* Ip4FindInterface(IN IP4_SERVICE *IpSb, IN IP4_ADDR Ip)
{ LIST_ENTRY *Entry; IP4_INTERFACE *IpIf; NET_LIST_FOR_EACH (Entry, &IpSb->Interfaces) { IpIf = NET_LIST_USER_STRUCT (Entry, IP4_INTERFACE, Link); if (IpIf->Configured && (IpIf->Ip == Ip)) { return IpIf; } } return NULL; }
tianocore/edk2
C++
Other
4,240
/* abort and set abort_read and abort_write to asked values. */
static void _rb_reset(ringbuf_t *rb, int abort_read, int abort_write)
/* abort and set abort_read and abort_write to asked values. */ static void _rb_reset(ringbuf_t *rb, int abort_read, int abort_write)
{ return; } aos_mutex_lock(&rb->lock, AOS_WAIT_FOREVER); rb->readptr = rb->writeptr = rb->base; rb->fill_cnt = 0; rb->writer_finished = 0; rb->reader_unblock = 0; rb->abort_read = abort_read; rb->abort_write = abort_write; aos_mutex_unlock(&rb->lock); }
alibaba/AliOS-Things
C++
Apache License 2.0
4,536
/* The hibernate module contains a 7-bit register field to store the year with valid values ranges from 0 to 99. In order to maximize the calendar year up to 2099, the */
void HibernateCalendarSet(struct tm *psTime)
/* The hibernate module contains a 7-bit register field to store the year with valid values ranges from 0 to 99. In order to maximize the calendar year up to 2099, the */ void HibernateCalendarSet(struct tm *psTime)
{ _HibernateCalendarSet(HIB_CAL0, psTime); }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Allocate new Big Number and assign the provided value to it. */
VOID* EFIAPI CryptoServiceBigNumFromBin(IN CONST UINT8 *Buf, IN UINTN Len)
/* Allocate new Big Number and assign the provided value to it. */ VOID* EFIAPI CryptoServiceBigNumFromBin(IN CONST UINT8 *Buf, IN UINTN Len)
{ return CALL_BASECRYPTLIB (Bn.Services.FromBin, BigNumFromBin, (Buf, Len), NULL); }
tianocore/edk2
C++
Other
4,240
/* Returns if 2 Unicode strings are not overlapped. */
BOOLEAN InternalSafeStringNoStrOverlap(IN CHAR16 *Str1, IN UINTN Size1, IN CHAR16 *Str2, IN UINTN Size2)
/* Returns if 2 Unicode strings are not overlapped. */ BOOLEAN InternalSafeStringNoStrOverlap(IN CHAR16 *Str1, IN UINTN Size1, IN CHAR16 *Str2, IN UINTN Size2)
{ return !InternalSafeStringIsOverlap (Str1, Size1 * sizeof (CHAR16), Str2, Size2 * sizeof (CHAR16)); }
tianocore/edk2
C++
Other
4,240
/* Disables the ADC DMA request after last transfer (Single-ADC mode) */
void ADC_DisableDMARequest(ADC_T *adc)
/* Disables the ADC DMA request after last transfer (Single-ADC mode) */ void ADC_DisableDMARequest(ADC_T *adc)
{ adc->CTRL2_B.DMADISSEL = BIT_RESET; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Write generic device register (platform dependent) WARNING: Functions declare in this section are defined at the end of this file and are strictly related to the hardware platform used. */
static int32_t platform_write(void *handle, uint8_t reg, uint8_t *bufp, uint16_t len)
/* Write generic device register (platform dependent) WARNING: Functions declare in this section are defined at the end of this file and are strictly related to the hardware platform used. */ static int32_t platform_write(void *handle, uint8_t reg, uint8_t *bufp, uint16_t len)
{ if (handle == &hi2c1) { reg |= 0x80; HAL_I2C_Mem_Write(handle, HTS221_I2C_ADDRESS, reg, I2C_MEMADD_SIZE_8BIT, bufp, len, 1000); } return 0; }
eclipse-threadx/getting-started
C++
Other
310
/* Deinitializes the SDIO peripheral registers to their default reset values. */
void SDIO_DeInit(void)
/* Deinitializes the SDIO peripheral registers to their default reset values. */ void SDIO_DeInit(void)
{ RCC_APB2PeriphResetCmd(RCC_APB2Periph_SDIO, ENABLE); RCC_APB2PeriphResetCmd(RCC_APB2Periph_SDIO, DISABLE); }
MaJerle/stm32f429
C++
null
2,036
/* Get minimum widget size. This function returns the minimum size that is required for showing the full widget and the caption. */
void wtk_button_size_hint(struct win_point *size, const char *caption)
/* Get minimum widget size. This function returns the minimum size that is required for showing the full widget and the caption. */ void wtk_button_size_hint(struct win_point *size, const char *caption)
{ Assert(size); Assert(caption); gfx_get_string_bounding_box(caption, &sysfont, &size->x, &size->y); size->x += 2; size->y += 2; }
memfault/zero-to-main
C++
null
200
/* This function returns %1 if the reference has been done, %0 if not, otherwise a negative error code is returned. */
static int done_already(struct rb_root *done_tree, int lnum)
/* This function returns %1 if the reference has been done, %0 if not, otherwise a negative error code is returned. */ static int done_already(struct rb_root *done_tree, int lnum)
{ struct rb_node **p = &done_tree->rb_node, *parent = NULL; struct done_ref *dr; while (*p) { parent = *p; dr = rb_entry(parent, struct done_ref, rb); if (lnum < dr->lnum) p = &(*p)->rb_left; else if (lnum > dr->lnum) p = &(*p)->rb_right; else return 1; } dr = kzalloc(sizeof(struct done_ref), GFP_NOFS); if (!dr) return -ENOMEM; dr->lnum = lnum; rb_link_node(&dr->rb, parent, p); rb_insert_color(&dr->rb, done_tree); return 0; }
robutest/uclinux
C++
GPL-2.0
60
/* Flushes the GTT write domain for the object if it's dirty. */
static void i915_gem_object_flush_gtt_write_domain(struct drm_gem_object *obj)
/* Flushes the GTT write domain for the object if it's dirty. */ static void i915_gem_object_flush_gtt_write_domain(struct drm_gem_object *obj)
{ uint32_t old_write_domain; if (obj->write_domain != I915_GEM_DOMAIN_GTT) return; old_write_domain = obj->write_domain; obj->write_domain = 0; trace_i915_gem_object_change_domain(obj, obj->read_domains, old_write_domain); }
robutest/uclinux
C++
GPL-2.0
60
/* Detect and register the correct Ethernet device. RealView/EB rev D platforms use the newer SMSC LAN9118 Ethernet chip */
static int eth_device_register(void)
/* Detect and register the correct Ethernet device. RealView/EB rev D platforms use the newer SMSC LAN9118 Ethernet chip */ static int eth_device_register(void)
{ void __iomem *eth_addr = ioremap(REALVIEW_EB_ETH_BASE, SZ_4K); const char *name = NULL; u32 idrev; if (!eth_addr) return -ENOMEM; idrev = readl(eth_addr + 0x50); if ((idrev & 0xFFFF0000) != 0x01180000) name = "smc91x"; iounmap(eth_addr); return realview_eth_register(name, realview_eb_eth_resources); }
EmcraftSystems/linux-emcraft
C++
Other
266
/* This function is used to set the interrupt about the number of period. */
int tls_pwm_stoptime_irq_cmd(u8 channel, bool en)
/* This function is used to set the interrupt about the number of period. */ int tls_pwm_stoptime_irq_cmd(u8 channel, bool en)
{ if(channel > (PWM_CHANNEL_MAX_NUM - 1)) return WM_FAILED; if (4 == channel) { if (en) tls_reg_write32(HR_PWM_INTEN, tls_reg_read32(HR_PWM_INTEN) | BIT(4)); else tls_reg_write32(HR_PWM_INTEN, tls_reg_read32(HR_PWM_INTEN) & (~BIT(4))); } else { if (en) tls_reg_write32(HR_PWM_INTEN, tls_reg_read32(HR_PWM_INTEN) | BIT(channel)); else tls_reg_write32(HR_PWM_INTEN, tls_reg_read32(HR_PWM_INTEN) & (~BIT(channel))); } return WM_SUCCESS; }
Nicholas3388/LuaNode
C++
Other
1,055
/* param base The I2C peripheral base address. return I2C instance number starting from 0. */
uint32_t I2C_GetInstance(I2C_Type *base)
/* param base The I2C peripheral base address. return I2C instance number starting from 0. */ uint32_t I2C_GetInstance(I2C_Type *base)
{ uint32_t i; for (i = 0; i < (uint32_t)FSL_FEATURE_SOC_I2C_COUNT; i++) { if ((uint32_t)base == s_i2cBaseAddrs[i]) { break; } } assert(i < (uint32_t)FSL_FEATURE_SOC_I2C_COUNT); return i; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* SECTION: Operations of the dasd_block layer. Timeout function for dasd_block. This is used when the block layer is waiting for something that may not come reliably, (e.g. a state change interrupt) */
static void dasd_block_timeout(unsigned long)
/* SECTION: Operations of the dasd_block layer. Timeout function for dasd_block. This is used when the block layer is waiting for something that may not come reliably, (e.g. a state change interrupt) */ static void dasd_block_timeout(unsigned long)
{ unsigned long flags; struct dasd_block *block; block = (struct dasd_block *) ptr; spin_lock_irqsave(get_ccwdev_lock(block->base->cdev), flags); dasd_device_remove_stop_bits(block->base, DASD_STOPPED_PENDING); spin_unlock_irqrestore(get_ccwdev_lock(block->base->cdev), flags); dasd_schedule_block_bh(block); }
robutest/uclinux
C++
GPL-2.0
60
/* It is claimed to be part of some future revision of the EPS spec. */
static void PhotoshopBanner(FILE *fd, uint32 w, uint32 h, int bs, int nc, char *startline)
/* It is claimed to be part of some future revision of the EPS spec. */ static void PhotoshopBanner(FILE *fd, uint32 w, uint32 h, int bs, int nc, char *startline)
{ fprintf(fd, "%%ImageData: %ld %ld %d %d 0 %d 2 \"", (long) w, (long) h, bitspersample, nc, bs); fprintf(fd, startline, nc); fprintf(fd, "\"\n"); }
alibaba/AliOS-Things
C++
Apache License 2.0
4,536
/* Set the tick mode of the RTC tick interrupt. The */
void RTCTickModeSet(unsigned long ulTickMode)
/* Set the tick mode of the RTC tick interrupt. The */ void RTCTickModeSet(unsigned long ulTickMode)
{ xASSERT((ulTickMode == RTC_TIME_TICK_1) || (ulTickMode == RTC_TIME_TICK_1_2) || (ulTickMode == RTC_TIME_TICK_1_4) || (ulTickMode == RTC_TIME_TICK_1_8) || (ulTickMode == RTC_TIME_TICK_1_16) || (ulTickMode == RTC_TIME_TICK_1_32) || (ulTickMode == RTC_TIME_TICK_1_64) || (ulTickMode == RTC_TIME_TICK_1_128)); RTCWriteEnable(); xHWREG(RTC_TTR) = ulTickMode; }
coocox/cox
C++
Berkeley Software Distribution (BSD)
104
/* Installs the Driver Binding Protocol specified by DriverBinding onto the handle specified by DriverBindingHandle. If DriverBindingHandle is NULL, then DriverBinding is installed onto a newly created handle. DriverBindingHandle is typically the same as the driver's ImageHandle, but it can be different if the driver produces multiple Driver Binding Protocols. If DriverBinding is NULL, then ASSERT(). If DriverBinding can not be installed onto a handle, then ASSERT(). */
EFI_STATUS EFIAPI EfiLibInstallDriverBinding(IN CONST EFI_HANDLE ImageHandle, IN CONST EFI_SYSTEM_TABLE *SystemTable, IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, IN EFI_HANDLE DriverBindingHandle)
/* Installs the Driver Binding Protocol specified by DriverBinding onto the handle specified by DriverBindingHandle. If DriverBindingHandle is NULL, then DriverBinding is installed onto a newly created handle. DriverBindingHandle is typically the same as the driver's ImageHandle, but it can be different if the driver produces multiple Driver Binding Protocols. If DriverBinding is NULL, then ASSERT(). If DriverBinding can not be installed onto a handle, then ASSERT(). */ EFI_STATUS EFIAPI EfiLibInstallDriverBinding(IN CONST EFI_HANDLE ImageHandle, IN CONST EFI_SYSTEM_TABLE *SystemTable, IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, IN EFI_HANDLE DriverBindingHandle)
{ EFI_STATUS Status; ASSERT (DriverBinding != NULL); DriverBinding->ImageHandle = ImageHandle; DriverBinding->DriverBindingHandle = DriverBindingHandle; Status = gBS->InstallMultipleProtocolInterfaces ( &DriverBinding->DriverBindingHandle, &gEfiDriverBindingProtocolGuid, DriverBinding, NULL ); ASSERT_EFI_ERROR (Status); return Status; }
tianocore/edk2
C++
Other
4,240
/* Overreliance on memalign is a sure way to fragment space. */
void * dlmemalign(size_t, size_t)
/* Overreliance on memalign is a sure way to fragment space. */ void * dlmemalign(size_t, size_t)
{ return dlmalloc(bytes); } return internal_memalign(gm, alignment, bytes); }
opentx/opentx
C++
GNU General Public License v2.0
2,025
/* Reads the values present of the specified Port. */
unsigned long xGPIOPortRead(unsigned long ulPort)
/* Reads the values present of the specified Port. */ unsigned long xGPIOPortRead(unsigned long ulPort)
{ return xHWREG(ulPort + GPIO_DOUT); }
coocox/cox
C++
Berkeley Software Distribution (BSD)
104
/* s3c_hsotg_txfifo_flush - flush Tx FIFO @hsotg: The driver state @idx: The index for the endpoint (0..15) */
static void s3c_hsotg_txfifo_flush(struct s3c_hsotg *hsotg, unsigned int idx)
/* s3c_hsotg_txfifo_flush - flush Tx FIFO @hsotg: The driver state @idx: The index for the endpoint (0..15) */ static void s3c_hsotg_txfifo_flush(struct s3c_hsotg *hsotg, unsigned int idx)
{ int timeout; int val; writel(GRSTCTL_TXFNUM(idx) | GRSTCTL_TXFFLSH, hsotg->regs + GRSTCTL); timeout = 100; while (1) { val = readl(hsotg->regs + GRSTCTL); if ((val & (GRSTCTL_TXFFLSH)) == 0) break; if (--timeout == 0) { dev_err(hsotg->dev, "%s: timeout flushing fifo (GRSTCTL=%08x)\n", __func__, val); break; } udelay(1); } }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Calculate the divisor, and turn it into the correct control bits to set in the result, @v. */
static unsigned int calc_0124(unsigned int cyc, unsigned long hclk_tns, unsigned long *v, int shift)
/* Calculate the divisor, and turn it into the correct control bits to set in the result, @v. */ static unsigned int calc_0124(unsigned int cyc, unsigned long hclk_tns, unsigned long *v, int shift)
{ unsigned int div = to_div(cyc, hclk_tns); unsigned long val; s3c_freq_iodbg("%s: cyc=%d, hclk=%lu, shift=%d => div %d\n", __func__, cyc, hclk_tns, shift, div); switch (div) { case 0: val = 0; break; case 1: val = 1; break; case 2: val = 2; break; case 3: case 4: val = 3; break; default: return -1; } *v |= val << shift; return 0; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* USBH_HID_InterfaceDeInit The function DeInit the Pipes used for the HID class. */
static USBH_StatusTypeDef USBH_HID_InterfaceDeInit(USBH_HandleTypeDef *phost)
/* USBH_HID_InterfaceDeInit The function DeInit the Pipes used for the HID class. */ static USBH_StatusTypeDef USBH_HID_InterfaceDeInit(USBH_HandleTypeDef *phost)
{ HID_HandleTypeDef *phhid = (HID_HandleTypeDef *) phost->pActiveClass->pData; if (phhid->InPipe != 0x00U) { (void)USBH_ClosePipe(phost, phhid->InPipe); (void)USBH_FreePipe(phost, phhid->InPipe); phhid->InPipe = 0U; } if (phhid->OutPipe != 0x00U) { (void)USBH_ClosePipe(phost, phhid->OutPipe); (void)USBH_FreePipe(phost, phhid->OutPipe); phhid->OutPipe = 0U; } if ((phost->pActiveClass->pData) != NULL) { phost->pActiveClass->pData = 0U; } return USBH_OK; }
ua1arn/hftrx
C++
null
69
/* The Stop() function is designed to be invoked from the EFI boot service DisconnectController(). As a result, much of the error checking on the parameters to Stop() has been moved into this common boot service. It is legal to call Stop() from other locations, but the following calling restrictions must be followed, or the system behavior will not be deterministic. */
EFI_STATUS EFIAPI RedfishDiscoverDriverBindingStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer OPTIONAL)
/* The Stop() function is designed to be invoked from the EFI boot service DisconnectController(). As a result, much of the error checking on the parameters to Stop() has been moved into this common boot service. It is legal to call Stop() from other locations, but the following calling restrictions must be followed, or the system behavior will not be deterministic. */ EFI_STATUS EFIAPI RedfishDiscoverDriverBindingStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer OPTIONAL)
{ return StopServiceOnNetworkInterface (This, ControllerHandle); }
tianocore/edk2
C++
Other
4,240
/* Enables LIN Function mode on the specified UART. */
void xUARTLINEnable(unsigned long ulBase)
/* Enables LIN Function mode on the specified UART. */ void xUARTLINEnable(unsigned long ulBase)
{ xASSERT(UARTBaseValid(ulBase)); xHWREG(ulBase + UART_FUN_SEL) |= (UART_FUN_SEL_LIN_EN); xHWREG(ulBase + UART_FUN_SEL) &= ~(UART_FUN_SEL_IRDA_EN); }
coocox/cox
C++
Berkeley Software Distribution (BSD)
104
/* This function sets a new TLS/SSL method for a particular TLS object. */
EFI_STATUS EFIAPI CryptoServiceTlsSetVersion(IN VOID *Tls, IN UINT8 MajorVer, IN UINT8 MinorVer)
/* This function sets a new TLS/SSL method for a particular TLS object. */ EFI_STATUS EFIAPI CryptoServiceTlsSetVersion(IN VOID *Tls, IN UINT8 MajorVer, IN UINT8 MinorVer)
{ return CALL_BASECRYPTLIB (TlsSet.Services.Version, TlsSetVersion, (Tls, MajorVer, MinorVer), EFI_UNSUPPORTED); }
tianocore/edk2
C++
Other
4,240
/* Synchronize the specified event ring to update the enqueue and dequeue pointer. */
EFI_STATUS XhcPeiSyncEventRing(IN PEI_XHC_DEV *Xhc, IN EVENT_RING *EvtRing)
/* Synchronize the specified event ring to update the enqueue and dequeue pointer. */ EFI_STATUS XhcPeiSyncEventRing(IN PEI_XHC_DEV *Xhc, IN EVENT_RING *EvtRing)
{ UINTN Index; TRB_TEMPLATE *EvtTrb; ASSERT (EvtRing != NULL); EvtTrb = EvtRing->EventRingDequeue; for (Index = 0; Index < EvtRing->TrbNumber; Index++) { if (EvtTrb->CycleBit != EvtRing->EventRingCCS) { break; } EvtTrb++; if ((UINTN)EvtTrb >= ((UINTN)EvtRing->EventRingSeg0 + sizeof (TRB_TEMPLATE) * EvtRing->TrbNumber)) { EvtTrb = EvtRing->EventRingSeg0; EvtRing->EventRingCCS = (EvtRing->EventRingCCS) ? 0 : 1; } } if (Index < EvtRing->TrbNumber) { EvtRing->EventRingEnqueue = EvtTrb; } else { ASSERT (FALSE); } return EFI_SUCCESS; }
tianocore/edk2
C++
Other
4,240
/* Return whether memory used by SMM page table need to be set as Read Only. */
BOOLEAN IfReadOnlyPageTableNeeded(VOID)
/* Return whether memory used by SMM page table need to be set as Read Only. */ BOOLEAN IfReadOnlyPageTableNeeded(VOID)
{ if (!IsRestrictedMemoryAccess () || ((PcdGet8 (PcdHeapGuardPropertyMask) & (BIT3 | BIT2)) != 0) || FeaturePcdGet (PcdCpuSmmProfileEnable)) { if (sizeof (UINTN) == sizeof (UINT64)) { ASSERT ( !(IsRestrictedMemoryAccess () && (PcdGet8 (PcdHeapGuardPropertyMask) & (BIT3 | BIT2)) != 0) ); ASSERT (!(IsRestrictedMemoryAccess () && FeaturePcdGet (PcdCpuSmmProfileEnable))); } return FALSE; } return TRUE; }
tianocore/edk2
C++
Other
4,240
/* param base PXP peripheral base address. param config Pointer to the configuration. */
void PXP_SetAlphaSurfaceBufferConfig(PXP_Type *base, const pxp_as_buffer_config_t *config)
/* param base PXP peripheral base address. param config Pointer to the configuration. */ void PXP_SetAlphaSurfaceBufferConfig(PXP_Type *base, const pxp_as_buffer_config_t *config)
{ assert(NULL != config); base->AS_CTRL = (base->AS_CTRL & ~PXP_AS_CTRL_FORMAT_MASK) | PXP_AS_CTRL_FORMAT(config->pixelFormat); base->AS_BUF = PXP_ADDR_CPU_2_IP(config->bufferAddr); base->AS_PITCH = config->pitchBytes; }
eclipse-threadx/getting-started
C++
Other
310
/* Read MAC address from EEPROM. mac address as appears over the air (OUI first) nvmem_get_mac_address */
UINT8 nvmem_get_mac_address(UINT8 *mac)
/* Read MAC address from EEPROM. mac address as appears over the air (OUI first) nvmem_get_mac_address */ UINT8 nvmem_get_mac_address(UINT8 *mac)
{ return nvmem_read(NVMEM_MAC_FILEID, MAC_ADDR_LEN, 0, mac); }
alibaba/AliOS-Things
C++
Apache License 2.0
4,536
/* This code gets the variable data offset related to variable header. */
UINTN GetVariableDataOffset(IN VARIABLE_HEADER *Variable, IN BOOLEAN AuthFormat)
/* This code gets the variable data offset related to variable header. */ UINTN GetVariableDataOffset(IN VARIABLE_HEADER *Variable, IN BOOLEAN AuthFormat)
{ UINTN Value; Value = GetVariableHeaderSize (AuthFormat); Value += NameSizeOfVariable (Variable, AuthFormat); Value += GET_PAD_SIZE (NameSizeOfVariable (Variable, AuthFormat)); return Value; }
tianocore/edk2
C++
Other
4,240
/* This function gets the platform specific data pointer. */
VOID* EFIAPI GetFspPlatformDataPointer(VOID)
/* This function gets the platform specific data pointer. */ VOID* EFIAPI GetFspPlatformDataPointer(VOID)
{ FSP_GLOBAL_DATA *FspData; FspData = GetFspGlobalDataPointer (); return FspData->PlatformData.DataPtr; }
tianocore/edk2
C++
Other
4,240
/* Process function helper. Displays floating channels based on the channel status register in the device structure. */
static int32_t cn0414_process_disp_floating_channels(struct cn0414_dev *dev)
/* Process function helper. Displays floating channels based on the channel status register in the device structure. */ static int32_t cn0414_process_disp_floating_channels(struct cn0414_dev *dev)
{ int32_t ret = 0; uint8_t i; for(i = 0; i < ADC_VOLTAGE_CHAN_NO; i++) { if(dev->chan_voltage_status[i] == 1) { ret = usr_uart_write_string(dev->uart_descriptor, (uint8_t*)"\nChannel "); if(ret != CN0414_SUCCESS) return ret; ret = usr_uart_write_string(dev->uart_descriptor, adc_chan_names[i]); if(ret != CN0414_SUCCESS) return ret; ret = usr_uart_write_string(dev->uart_descriptor, (uint8_t*)" FLOATING\n"); if(ret != CN0414_SUCCESS) return ret; dev->chan_voltage_status[i] = 2; } } return ret; }
analogdevicesinc/EVAL-ADICUP3029
C++
Other
36
/* Set the USCI_SPI bus clock. Only available in Master mode. */
uint32_t USPI_SetBusClock(USPI_T *uspi, uint32_t u32BusClock)
/* Set the USCI_SPI bus clock. Only available in Master mode. */ uint32_t USPI_SetBusClock(USPI_T *uspi, uint32_t u32BusClock)
{ uint32_t u32ClkDiv; uint32_t u32Pclk; if((uspi == USPI0) || (uspi == USPI0_NS)) { u32Pclk = CLK_GetPCLK0Freq(); } else { u32Pclk = CLK_GetPCLK1Freq(); } u32ClkDiv = (uint32_t)((((((u32Pclk / 2UL) * 10UL) / (u32BusClock)) + 5UL) / 10UL) - 1UL); uspi->BRGEN &= ~USPI_BRGEN_CLKDIV_Msk; uspi->BRGEN |= (u32ClkDiv << USPI_BRGEN_CLKDIV_Pos); return (u32Pclk / ((u32ClkDiv + 1UL) << 1UL)); }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* device_pm_lock - Lock the list of active devices used by the PM core. */
void device_pm_lock(void)
/* device_pm_lock - Lock the list of active devices used by the PM core. */ void device_pm_lock(void)
{ mutex_lock(&dpm_list_mtx); }
robutest/uclinux
C++
GPL-2.0
60
/* Return TRUE when the page table entry is a leaf entry that points to the physical address memory. Return FALSE when the page table entry is a non-leaf entry that points to the page table entries. */
BOOLEAN IsPle(IN IA32_PAGING_ENTRY *PagingEntry, IN UINTN Level)
/* Return TRUE when the page table entry is a leaf entry that points to the physical address memory. Return FALSE when the page table entry is a non-leaf entry that points to the page table entries. */ BOOLEAN IsPle(IN IA32_PAGING_ENTRY *PagingEntry, IN UINTN Level)
{ if (Level == 1) { return TRUE; } if (((Level == 3) || (Level == 2))) { if (PagingEntry->PleB.Bits.MustBeOne == 1) { return TRUE; } } return FALSE; }
tianocore/edk2
C++
Other
4,240
/* Created on: 16 feb. 2019 Author: Daniel Mårtensson */
void loadEigen(integer row, doublereal *wr, doublereal *wi, double *Ereal, double *Eimag)
/* Created on: 16 feb. 2019 Author: Daniel Mårtensson */ void loadEigen(integer row, doublereal *wr, doublereal *wi, double *Ereal, double *Eimag)
{ if (WI[j] == (double) 0.0) { *(Ereal++) = WR[j]; *(Eimag++) = 0; } else { *(Ereal++) = WR[j]; *(Eimag++) = WI[j]; } } }
DanielMartensson/EmbeddedLapack
C++
MIT License
129
/* Enables or disables the fast conversion mode for the SDADC. */
void SDADC_FastConversionCmd(SDADC_TypeDef *SDADCx, FunctionalState NewState)
/* Enables or disables the fast conversion mode for the SDADC. */ void SDADC_FastConversionCmd(SDADC_TypeDef *SDADCx, FunctionalState NewState)
{ assert_param(IS_SDADC_ALL_PERIPH(SDADCx)); assert_param(IS_FUNCTIONAL_STATE(NewState)); if (NewState != DISABLE) { SDADCx->CR2 |= SDADC_CR2_FAST; } else { SDADCx->CR2 &= (uint32_t)(~SDADC_CR2_FAST); } }
avem-labs/Avem
C++
MIT License
1,752
/* Called before an ethtool operation. We need to make sure the chip is out of D3 state before we poke at it. */
static int velocity_ethtool_up(struct net_device *dev)
/* Called before an ethtool operation. We need to make sure the chip is out of D3 state before we poke at it. */ static int velocity_ethtool_up(struct net_device *dev)
{ struct velocity_info *vptr = netdev_priv(dev); if (!netif_running(dev)) pci_set_power_state(vptr->pdev, PCI_D0); return 0; }
robutest/uclinux
C++
GPL-2.0
60
/* Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via the status LEDs, disables the sample update and PWM output timers and stops the USB and Audio management tasks. */
void EVENT_USB_Device_Disconnect(void)
/* Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via the status LEDs, disables the sample update and PWM output timers and stops the USB and Audio management tasks. */ void EVENT_USB_Device_Disconnect(void)
{ TCCR0B = 0; StreamingAudioInterfaceSelected = false; LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); }
prusa3d/Prusa-Firmware-Buddy
C++
Other
1,019
/* Deinitializes all resources used by the Smartcard interface. */
static void SC_DeInit(void)
/* Deinitializes all resources used by the Smartcard interface. */ static void SC_DeInit(void)
{ SC_PowerCmd(DISABLE); HAL_SMARTCARD_DeInit(&SCHandle); }
STMicroelectronics/STM32CubeF4
C++
Other
789