docstring stringlengths 22 576 | signature stringlengths 9 317 | prompt stringlengths 57 886 | code stringlengths 20 1.36k | repository stringclasses 49 values | language stringclasses 2 values | license stringclasses 9 values | stars int64 15 21.3k |
|---|---|---|---|---|---|---|---|
/* Set *choice to point to the default item's data, if any default item was set, and returns 1. If no default item was set, returns -ENOENT. */ | int menu_default_choice(struct menu *m, void **choice) | /* Set *choice to point to the default item's data, if any default item was set, and returns 1. If no default item was set, returns -ENOENT. */
int menu_default_choice(struct menu *m, void **choice) | {
if (m->default_item) {
*choice = m->default_item->data;
return 1;
}
return -ENOENT;
} | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* Output: void, will modify proto_tree if not null. */ | static void dissect_hello_area_address_clv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, int id_length _U_, int length) | /* Output: void, will modify proto_tree if not null. */
static void dissect_hello_area_address_clv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, int id_length _U_, int length) | {
isis_dissect_area_address_clv(tree, pinfo, tvb, &ei_isis_hello_short_packet, hf_isis_hello_area_address, offset, length);
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Turn off the cache with regard to a per-inode cookie if opened for writing, invalidating all the pages in the page cache relating to the associated inode to clear the per-page caching. */ | static void nfs_fscache_disable_inode_cookie(struct inode *inode) | /* Turn off the cache with regard to a per-inode cookie if opened for writing, invalidating all the pages in the page cache relating to the associated inode to clear the per-page caching. */
static void nfs_fscache_disable_inode_cookie(struct inode *inode) | {
clear_bit(NFS_INO_FSCACHE, &NFS_I(inode)->flags);
if (NFS_I(inode)->fscache) {
dfprintk(FSCACHE,
"NFS: nfsi 0x%p turning cache off\n", NFS_I(inode));
if (inode->i_mapping && inode->i_mapping->nrpages)
invalidate_inode_pages2(inode->i_mapping);
nfs_fscache_zap_inode_cookie(inode);
}
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Converts a Relative Offset device path structure to its string representative. */ | VOID DevPathRelativeOffsetRange(IN OUT POOL_PRINT *Str, IN VOID *DevPath, IN BOOLEAN DisplayOnly, IN BOOLEAN AllowShortcuts) | /* Converts a Relative Offset device path structure to its string representative. */
VOID DevPathRelativeOffsetRange(IN OUT POOL_PRINT *Str, IN VOID *DevPath, IN BOOLEAN DisplayOnly, IN BOOLEAN AllowShortcuts) | {
MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH *Offset;
Offset = DevPath;
UefiDevicePathLibCatPrint (
Str,
L"Offset(0x%lx,0x%lx)",
Offset->StartingOffset,
Offset->EndingOffset
);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Returns the last data output value of the selected DAC channel. */ | uint16_t DAC_ReadDataOutputValue(DAC_CHANNEL_T channel) | /* Returns the last data output value of the selected DAC channel. */
uint16_t DAC_ReadDataOutputValue(DAC_CHANNEL_T channel) | {
uint16_t data;
if(channel == DAC_CHANNEL_1)
{
data = DAC->DATAOCH1_B.DATA;
}
else
{
data = DAC->DATAOCH2_B.DATA;
}
return data;
} | pikasTech/PikaPython | C++ | MIT License | 1,403 |
/* Checks if there is new accel/gyro data available for read. In case of ver 0.3.0 and older of the PIC firmware the state of the PIC_INT_WAKE needs to be read to determinte if the IMU interrupt is valid. */ | bool IMU_isDataReadyFlag(void) | /* Checks if there is new accel/gyro data available for read. In case of ver 0.3.0 and older of the PIC firmware the state of the PIC_INT_WAKE needs to be read to determinte if the IMU interrupt is valid. */
bool IMU_isDataReadyFlag(void) | {
bool ready;
unsigned int pin;
if( IMU_state != IMU_STATE_READY ){
return false;
}
ready = dataReady;
if( BOARD_picIsLegacyIntCtrl() ) {
pin = GPIO_PinInGet( BOARD_PIC_INT_WAKE_PORT, BOARD_PIC_INT_WAKE_PIN );
if( pin == 0 ) {
ready = true;
}
}
return ready;
} | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* zynq_nand_write_page_raw - raw page write function @mtd: mtd info structure @chip: nand chip info structure @buf: data buffer @oob_required: must write chip->oob_poi to OOB */ | static int zynq_nand_write_page_raw(struct mtd_info *mtd, struct nand_chip *chip, const u8 *buf, int oob_required, int page) | /* zynq_nand_write_page_raw - raw page write function @mtd: mtd info structure @chip: nand chip info structure @buf: data buffer @oob_required: must write chip->oob_poi to OOB */
static int zynq_nand_write_page_raw(struct mtd_info *mtd, struct nand_chip *chip, const u8 *buf, int oob_required, int page) | {
unsigned long data_width = 4;
unsigned long data_phase_addr = 0;
u8 *p;
chip->write_buf(mtd, buf, mtd->writesize);
p = chip->oob_poi;
chip->write_buf(mtd, p, (mtd->oobsize - data_width));
p += (mtd->oobsize - data_width);
data_phase_addr = (unsigned long)chip->IO_ADDR_W;
data_phase_addr |= ZYNQ_NAND_CLEAR_CS;
data_phase_addr |= (1 << END_CMD_VALID_SHIFT);
chip->IO_ADDR_W = (void __iomem *)data_phase_addr;
chip->write_buf(mtd, p, data_width);
return 0;
} | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* This function delete all dynamic entries from the ARP cache that match the specified software protocol type. */ | EFI_STATUS EFIAPI ArpFlush(IN EFI_ARP_PROTOCOL *This) | /* This function delete all dynamic entries from the ARP cache that match the specified software protocol type. */
EFI_STATUS EFIAPI ArpFlush(IN EFI_ARP_PROTOCOL *This) | {
ARP_INSTANCE_DATA *Instance;
UINTN Count;
EFI_TPL OldTpl;
if (This == NULL) {
return EFI_INVALID_PARAMETER;
}
Instance = ARP_INSTANCE_DATA_FROM_THIS (This);
if (!Instance->Configured) {
return EFI_NOT_STARTED;
}
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
Count = ArpDeleteCacheEntry (Instance, FALSE, NULL, FALSE);
gBS->RestoreTPL (OldTpl);
return (Count == 0) ? EFI_NOT_FOUND : EFI_SUCCESS;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Allocate memory from the heap. Check that we don't collide with the stack right now (some other routine might later). A watchdog might be used to check if cur_break and the stack pointer meet during runtime. */ | void* sbrk(int incr) | /* Allocate memory from the heap. Check that we don't collide with the stack right now (some other routine might later). A watchdog might be used to check if cur_break and the stack pointer meet during runtime. */
void* sbrk(int incr) | {
char *stack_pointer;
asmv("mov r1, %0" : "=r"(stack_pointer));
stack_pointer -= STACK_EXTRA;
if (incr > (stack_pointer - cur_break)) {
return (void *) - 1;
}
void *old_break = cur_break;
cur_break += incr;
return old_break;
} | labapart/polymcu | C++ | null | 201 |
/* Gets a handle to a DMA channel.
This function returns a handle, representing a control block of a particular DMA channel */ | dmacHw_HANDLE_t dmacHw_getChannelHandle(dmacHw_ID_t channelId) | /* Gets a handle to a DMA channel.
This function returns a handle, representing a control block of a particular DMA channel */
dmacHw_HANDLE_t dmacHw_getChannelHandle(dmacHw_ID_t channelId) | {
int idx;
switch ((channelId >> 8)) {
case 0:
dmacHw_ASSERT((channelId & 0xff) < dmaChannelCount_0);
idx = (channelId & 0xff);
break;
case 1:
dmacHw_ASSERT((channelId & 0xff) < dmaChannelCount_1);
idx = dmaChannelCount_0 + (channelId & 0xff);
break;
default:
dmacHw_ASSERT(0);
return (dmacHw_HANDLE_t) -1;
}
return dmacHw_CBLK_TO_HANDLE(&dmacHw_gCblk[idx]);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* ps2pp_cmd() sends a PS2++ command, sliced into two bit pieces through the SETRES command. This is needed to send extended commands to mice on notebooks that try to understand the PS/2 protocol Ugly. */ | static int ps2pp_cmd(struct psmouse *psmouse, unsigned char *param, unsigned char command) | /* ps2pp_cmd() sends a PS2++ command, sliced into two bit pieces through the SETRES command. This is needed to send extended commands to mice on notebooks that try to understand the PS/2 protocol Ugly. */
static int ps2pp_cmd(struct psmouse *psmouse, unsigned char *param, unsigned char command) | {
if (psmouse_sliced_command(psmouse, command))
return -1;
if (ps2_command(&psmouse->ps2dev, param, PSMOUSE_CMD_POLL | 0x0300))
return -1;
return 0;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* This function is executed in case of error occurrence. */ | static void Error_Handler(void) | /* This function is executed in case of error occurrence. */
static void Error_Handler(void) | {
while(1)
{
BSP_LED_Toggle(LED3);
HAL_Delay(40);
}
} | STMicroelectronics/STM32CubeF4 | C++ | Other | 789 |
/* frees line-locks and segment locks for all segments in comdata structure. Optionally sets state of file-system to FM_DIRTY in super-block. log age of page-frames in memory for which caller has are reset to 0 (to avoid logwarap). */ | void txAbort(tid_t tid, int dirty) | /* frees line-locks and segment locks for all segments in comdata structure. Optionally sets state of file-system to FM_DIRTY in super-block. log age of page-frames in memory for which caller has are reset to 0 (to avoid logwarap). */
void txAbort(tid_t tid, int dirty) | {
lid_t lid, next;
struct metapage *mp;
struct tblock *tblk = tid_to_tblock(tid);
struct tlock *tlck;
for (lid = tblk->next; lid; lid = next) {
tlck = lid_to_tlock(lid);
next = tlck->next;
mp = tlck->mp;
JFS_IP(tlck->ip)->xtlid = 0;
if (mp) {
mp->lid = 0;
if (mp->xflag & COMMIT_PAGE && mp->lsn)
LogSyncRelease(mp);
}
TXN_LOCK();
txLockFree(lid);
TXN_UNLOCK();
}
tblk->next = tblk->last = 0;
if (dirty)
jfs_error(tblk->sb, "txAbort");
return;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* \method callback(fun) Set the function to be called when the timer triggers. */ | STATIC mp_obj_t pyb_timer_callback(mp_obj_t self_in, mp_obj_t callback) | /* \method callback(fun) Set the function to be called when the timer triggers. */
STATIC mp_obj_t pyb_timer_callback(mp_obj_t self_in, mp_obj_t callback) | {
self->callback = mp_const_none;
} else if (mp_obj_is_callable(callback)) {
self->callback = callback;
} else {
mp_raise_ValueError(MP_ERROR_TEXT("callback must be None or a callable object"));
}
return mp_const_none;
} | micropython/micropython | C++ | Other | 18,334 |
/* This routine will return the hotplug slot structure for a given device node. Note that built-in PCI slots may be dlpar-able, but not hot-pluggable, so this routine will return NULL for built-in PCI slots. */ | static struct slot* find_php_slot(struct device_node *dn) | /* This routine will return the hotplug slot structure for a given device node. Note that built-in PCI slots may be dlpar-able, but not hot-pluggable, so this routine will return NULL for built-in PCI slots. */
static struct slot* find_php_slot(struct device_node *dn) | {
struct list_head *tmp, *n;
struct slot *slot;
list_for_each_safe(tmp, n, &rpaphp_slot_head) {
slot = list_entry(tmp, struct slot, rpaphp_slot_list);
if (slot->dn == dn)
return slot;
}
return NULL;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Refer to SD Physical Layer Simplified Spec 4.1 Section 4.7 for details. */ | EFI_STATUS SdPeimVoltageSwitch(IN SD_PEIM_HC_SLOT *Slot) | /* Refer to SD Physical Layer Simplified Spec 4.1 Section 4.7 for details. */
EFI_STATUS SdPeimVoltageSwitch(IN SD_PEIM_HC_SLOT *Slot) | {
SD_COMMAND_BLOCK SdCmdBlk;
SD_STATUS_BLOCK SdStatusBlk;
SD_COMMAND_PACKET Packet;
EFI_STATUS Status;
ZeroMem (&SdCmdBlk, sizeof (SdCmdBlk));
ZeroMem (&SdStatusBlk, sizeof (SdStatusBlk));
ZeroMem (&Packet, sizeof (Packet));
Packet.SdCmdBlk = &SdCmdBlk;
Packet.SdStatusBlk = &SdStatusBlk;
Packet.Timeout = SD_TIMEOUT;
SdCmdBlk.CommandIndex = SD_VOLTAGE_SWITCH;
SdCmdBlk.CommandType = SdCommandTypeAc;
SdCmdBlk.ResponseType = SdResponseTypeR1;
SdCmdBlk.CommandArgument = 0;
Status = SdPeimExecCmd (Slot, &Packet);
return Status;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Converts a UFS device path structure to its string representative. */ | VOID DevPathToTextUfs(IN OUT POOL_PRINT *Str, IN VOID *DevPath, IN BOOLEAN DisplayOnly, IN BOOLEAN AllowShortcuts) | /* Converts a UFS device path structure to its string representative. */
VOID DevPathToTextUfs(IN OUT POOL_PRINT *Str, IN VOID *DevPath, IN BOOLEAN DisplayOnly, IN BOOLEAN AllowShortcuts) | {
UFS_DEVICE_PATH *Ufs;
Ufs = DevPath;
UefiDevicePathLibCatPrint (Str, L"UFS(0x%x,0x%x)", Ufs->Pun, Ufs->Lun);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Starts the output compare signal generation on the designed timer output. */ | void HRTIM_SimpleOCStart(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t OCChannel) | /* Starts the output compare signal generation on the designed timer output. */
void HRTIM_SimpleOCStart(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t OCChannel) | {
assert_param(IS_HRTIM_TIMER_OUTPUT(TimerIdx, OCChannel));
(HRTIMx->HRTIM_COMMON).OENR |= OCChannel;
__HRTIM_ENABLE(HRTIMx, TimerIdxToTimerId[TimerIdx]);
} | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* This function is used to set a timer for a time sometime in the future. The function */ | void timer_set(struct timer *t, clock_time_t interval) | /* This function is used to set a timer for a time sometime in the future. The function */
void timer_set(struct timer *t, clock_time_t interval) | {
t->interval = interval;
t->start = clock_time();
} | apopple/Pandaboard-FreeRTOS | C++ | null | 25 |
/* Note: because we don't initialise everything on reallocation out of the zone, we must ensure we nullify everything correctly before freeing the structure. */ | void xfs_ireclaim(struct xfs_inode *ip) | /* Note: because we don't initialise everything on reallocation out of the zone, we must ensure we nullify everything correctly before freeing the structure. */
void xfs_ireclaim(struct xfs_inode *ip) | {
struct xfs_mount *mp = ip->i_mount;
struct xfs_perag *pag;
xfs_agino_t agino = XFS_INO_TO_AGINO(mp, ip->i_ino);
XFS_STATS_INC(xs_ig_reclaims);
pag = xfs_get_perag(mp, ip->i_ino);
write_lock(&pag->pag_ici_lock);
if (!radix_tree_delete(&pag->pag_ici_root, agino))
ASSERT(0);
write_unlock(&pag->pag_ici_lock);
xfs_put_perag(mp, pag);
xfs_ilock(ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL);
xfs_qm_dqdetach(ip);
xfs_iunlock(ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL);
xfs_inode_free(ip);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Since both peers must reset the dictionary at the same time even in the absence of CLEAR codes (while packets are incompressible), they must compute the same ratio. */ | static int bsd_check(struct bsd_db *db) | /* Since both peers must reset the dictionary at the same time even in the absence of CLEAR codes (while packets are incompressible), they must compute the same ratio. */
static int bsd_check(struct bsd_db *db) | {
unsigned int new_ratio;
if (db->in_count >= db->checkpoint)
{
if (db->in_count >= RATIO_MAX || db->bytes_out >= RATIO_MAX)
{
db->in_count -= (db->in_count >> 2);
db->bytes_out -= (db->bytes_out >> 2);
}
db->checkpoint = db->in_count + CHECK_GAP;
if (db->max_ent >= db->maxmaxcode)
{
new_ratio = db->in_count << RATIO_SCALE_LOG;
if (db->bytes_out != 0)
{
new_ratio /= db->bytes_out;
}
if (new_ratio < db->ratio || new_ratio < 1 * RATIO_SCALE)
{
bsd_clear (db);
return 1;
}
db->ratio = new_ratio;
}
}
return 0;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* This file is part of the Simba project. */ | int mock_write_fat16_init(fat16_read_t read, fat16_write_t write, void *arg_p, unsigned int partition, int res) | /* This file is part of the Simba project. */
int mock_write_fat16_init(fat16_read_t read, fat16_write_t write, void *arg_p, unsigned int partition, int res) | {
harness_mock_write("fat16_init(read)",
&read,
sizeof(read));
harness_mock_write("fat16_init(write)",
&write,
sizeof(write));
harness_mock_write("fat16_init(arg_p)",
arg_p,
sizeof(arg_p));
harness_mock_write("fat16_init(partition)",
&partition,
sizeof(partition));
harness_mock_write("fat16_init(): return (res)",
&res,
sizeof(res));
return (0);
} | eerimoq/simba | C++ | Other | 337 |
/* Installs the given bpf filter program in the given pcap structure. There is no attempt to store the filter in kernel memory as that is not supported with DAG cards. */ | static int dag_setfilter(pcap_t *p, struct bpf_program *fp) | /* Installs the given bpf filter program in the given pcap structure. There is no attempt to store the filter in kernel memory as that is not supported with DAG cards. */
static int dag_setfilter(pcap_t *p, struct bpf_program *fp) | {
if (!p)
return -1;
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 |
/* Returns: (element-type GVolume) (transfer full): #GList containing any #GVolume objects on the given @drive. */ | GList* g_drive_get_volumes(GDrive *drive) | /* Returns: (element-type GVolume) (transfer full): #GList containing any #GVolume objects on the given @drive. */
GList* g_drive_get_volumes(GDrive *drive) | {
GDriveIface *iface;
g_return_val_if_fail (G_IS_DRIVE (drive), NULL);
iface = G_DRIVE_GET_IFACE (drive);
return (* iface->get_volumes) (drive);
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Enables or disables the USART's Half Duplex communication. */ | void USART_HalfDuplexCmd(USART_TypeDef *USARTx, FunctionalState NewState) | /* Enables or disables the USART's Half Duplex communication. */
void USART_HalfDuplexCmd(USART_TypeDef *USARTx, FunctionalState NewState) | {
assert_param(IS_USART_ALL_PERIPH(USARTx));
assert_param(IS_FUNCTIONAL_STATE(NewState));
if (NewState != DISABLE)
{
USARTx->CR3 |= USART_CR3_HDSEL;
}
else
{
USARTx->CR3 &= (uint32_t)~((uint32_t)USART_CR3_HDSEL);
}
} | ajhc/demo-cortex-m3 | C++ | null | 38 |
/* A data_ready event on a listening socket means there's a connection pending. Do not use state_change as a substitute for it. */ | static void svc_tcp_listen_data_ready(struct sock *sk, int count_unused) | /* A data_ready event on a listening socket means there's a connection pending. Do not use state_change as a substitute for it. */
static void svc_tcp_listen_data_ready(struct sock *sk, int count_unused) | {
struct svc_sock *svsk = (struct svc_sock *)sk->sk_user_data;
dprintk("svc: socket %p TCP (listen) state change %d\n",
sk, sk->sk_state);
if (sk->sk_state == TCP_LISTEN) {
if (svsk) {
set_bit(XPT_CONN, &svsk->sk_xprt.xpt_flags);
svc_xprt_enqueue(&svsk->sk_xprt);
} else
printk("svc: socket %p: no user data\n", sk);
}
if (sk->sk_sleep && waitqueue_active(sk->sk_sleep))
wake_up_interruptible_all(sk->sk_sleep);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Returns true if the device being checked is known to be a CSB series device. */ | static u8 serverworks_is_csb(struct pci_dev *pdev) | /* Returns true if the device being checked is known to be a CSB series device. */
static u8 serverworks_is_csb(struct pci_dev *pdev) | {
switch (pdev->device) {
case PCI_DEVICE_ID_SERVERWORKS_CSB5IDE:
case PCI_DEVICE_ID_SERVERWORKS_CSB6IDE:
case PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2:
case PCI_DEVICE_ID_SERVERWORKS_HT1000IDE:
return 1;
default:
break;
}
return 0;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Checks if Big Number equals to the given Num. */ | BOOLEAN EFIAPI CryptoServiceBigNumIsWord(IN CONST VOID *Bn, IN UINTN Num) | /* Checks if Big Number equals to the given Num. */
BOOLEAN EFIAPI CryptoServiceBigNumIsWord(IN CONST VOID *Bn, IN UINTN Num) | {
return CALL_BASECRYPTLIB (Bn.Services.IsWord, BigNumIsWord, (Bn, Num), FALSE);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* This is gets invoked once during initialization, to set */ | static int __init ide_init(void) | /* This is gets invoked once during initialization, to set */
static int __init ide_init(void) | {
int ret;
printk(KERN_INFO "Uniform Multi-Platform E-IDE driver\n");
ret = bus_register(&ide_bus_type);
if (ret < 0) {
printk(KERN_WARNING "IDE: bus_register error: %d\n", ret);
return ret;
}
ide_port_class = class_create(THIS_MODULE, "ide_port");
if (IS_ERR(ide_port_class)) {
ret = PTR_ERR(ide_port_class);
goto out_port_class;
}
ide_acpi_init();
proc_ide_create();
return 0;
out_port_class:
bus_unregister(&ide_bus_type);
return ret;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Returns the transfer count for an integrated USB DMA channel. */ | uint32_t USBDMAChannelCountGet(uint32_t ui32Base, uint32_t ui32Channel) | /* Returns the transfer count for an integrated USB DMA channel. */
uint32_t USBDMAChannelCountGet(uint32_t ui32Base, uint32_t ui32Channel) | {
ASSERT(ui32Base == USB0_BASE);
ASSERT(ui32Channel < 8);
return (HWREG(ui32Base + USB_O_DMACOUNT0 + (0x10 * ui32Channel)));
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* See the vsnprintf() documentation for format string extensions over C99. */ | int snprintf(char *buf, size_t size, const char *fmt,...) | /* See the vsnprintf() documentation for format string extensions over C99. */
int snprintf(char *buf, size_t size, const char *fmt,...) | {
va_list args;
int i;
va_start(args, fmt);
i = vsnprintf(buf, size, fmt, args);
va_end(args);
return i;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Note that the HW models should register their initialization functions as NSI_TASKS of HW_INIT level. */ | void nsi_hws_init(void) | /* Note that the HW models should register their initialization functions as NSI_TASKS of HW_INIT level. */
void nsi_hws_init(void) | {
number_of_events = __nsi_hw_events_end - __nsi_hw_events_start;
nsi_hws_set_sig_handler();
nsi_hws_find_next_event();
} | zephyrproject-rtos/zephyr | C++ | Apache License 2.0 | 9,573 |
/* Checks whether the specified RTC interrupt has occurred or not. */ | INTStatus RTC_GetITStatus(uint32_t RTC_INT) | /* Checks whether the specified RTC interrupt has occurred or not. */
INTStatus RTC_GetITStatus(uint32_t RTC_INT) | {
INTStatus bitstatus = RESET;
uint32_t tmpregister = 0, enablestatus = 0;
assert_param(IS_RTC_GET_INT(RTC_INT));
enablestatus = (uint32_t)((RTC->CTRL & RTC_INT));
tmpregister = (uint32_t)((RTC->INITSTS & (uint32_t)(RTC_INT >> 4)));
if ((enablestatus != (uint32_t)RESET) && ((tmpregister & 0x0000FFFF) != (uint32_t)RESET))
{
bitstatus = SET;
}
else
{
bitstatus = RESET;
}
return bitstatus;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Event handler for the USB device Start Of Frame event. */ | void EVENT_USB_Device_StartOfFrame(void) | /* Event handler for the USB device Start Of Frame event. */
void EVENT_USB_Device_StartOfFrame(void) | {
HID_Device_MillisecondElapsed(&Device_HID_Interface);
} | prusa3d/Prusa-Firmware-Buddy | C++ | Other | 1,019 |
/* However, the OpenGroup XNFS spec provides a simple mapping that is independent of local errno values on the server and the client. */ | static int decode_status(struct xdr_stream *xdr, struct mountres *res) | /* However, the OpenGroup XNFS spec provides a simple mapping that is independent of local errno values on the server and the client. */
static int decode_status(struct xdr_stream *xdr, struct mountres *res) | {
unsigned int i;
u32 status;
__be32 *p;
p = xdr_inline_decode(xdr, sizeof(status));
if (unlikely(p == NULL))
return -EIO;
status = ntohl(*p);
for (i = 0; i < ARRAY_SIZE(mnt_errtbl); i++) {
if (mnt_errtbl[i].status == status) {
res->errno = mnt_errtbl[i].errno;
return 0;
}
}
dprintk("NFS: unrecognized MNT status code: %u\n", status);
res->errno = -EACCES;
return 0;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Local function to handle the USB-CDC class requests */ | static BOOL HandleClassRequest(TSetupPacket *pSetup, int *piLen, unsigned char **ppbData) | /* Local function to handle the USB-CDC class requests */
static BOOL HandleClassRequest(TSetupPacket *pSetup, int *piLen, unsigned char **ppbData) | {
switch (pSetup->bRequest) {
case SET_LINE_CODING:
DBG("SET_LINE_CODING\n");
memcpy((unsigned char *)&LineCoding, *ppbData, 7);
*piLen = 7;
DBG("dwDTERate=%u, bCharFormat=%u, bParityType=%u, bDataBits=%u\n",
LineCoding.dwDTERate,
LineCoding.bCharFormat,
LineCoding.bParityType,
LineCoding.bDataBits);
break;
case GET_LINE_CODING:
DBG("GET_LINE_CODING\n");
*ppbData = (unsigned char *)&LineCoding;
*piLen = 7;
break;
case SET_CONTROL_LINE_STATE:
DBG("SET_CONTROL_LINE_STATE %X\n", pSetup->wValue);
break;
default:
return FALSE;
}
return TRUE;
} | apopple/Pandaboard-FreeRTOS | C++ | null | 25 |
/* If you see RED led, then press reset button. After that, you should see GREEN led, which indicates successful write */ | int main(void) | /* If you see RED led, then press reset button. After that, you should see GREEN led, which indicates successful write */
int main(void) | {
TM_DISCO_LedOn(LED_GREEN);
} else {
TM_BKPSRAM_Write8(0x00, 0x15);
TM_DISCO_LedOn(LED_RED);
}
while (1) {
}
} | MaJerle/stm32f429 | C++ | null | 2,036 |
/* The destructor of the current instance of #CRSimpleSel. */ | void cr_simple_sel_destroy(CRSimpleSel *a_this) | /* The destructor of the current instance of #CRSimpleSel. */
void cr_simple_sel_destroy(CRSimpleSel *a_this) | {
g_return_if_fail (a_this);
if (a_this->name) {
cr_string_destroy (a_this->name);
a_this->name = NULL;
}
if (a_this->add_sel) {
cr_additional_sel_destroy (a_this->add_sel);
a_this->add_sel = NULL;
}
if (a_this->next) {
cr_simple_sel_destroy (a_this->next);
}
if (a_this) {
g_free (a_this);
}
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* NOTE: gpio_flags_t b are defined in the dt-binding gpio header. b are defined in the driver gpio header. Hardware only supports push-pull or open-drain. */ | static int gpio_xec_validate_flags(gpio_flags_t flags) | /* NOTE: gpio_flags_t b are defined in the dt-binding gpio header. b are defined in the driver gpio header. Hardware only supports push-pull or open-drain. */
static int gpio_xec_validate_flags(gpio_flags_t flags) | {
if ((flags & (GPIO_SINGLE_ENDED | GPIO_LINE_OPEN_DRAIN))
== (GPIO_SINGLE_ENDED | GPIO_LINE_OPEN_SOURCE)) {
return -ENOTSUP;
}
if ((flags & (GPIO_INPUT | GPIO_OUTPUT))
== (GPIO_INPUT | GPIO_OUTPUT)) {
return -ENOTSUP;
}
if ((flags & GPIO_OUTPUT_INIT_LOW) && (flags & GPIO_OUTPUT_INIT_HIGH)) {
return -EINVAL;
}
return 0;
} | zephyrproject-rtos/zephyr | C++ | Apache License 2.0 | 9,573 |
/* Return the exception data for a sector, or NULL if not remapped. */ | static struct dm_exception* dm_lookup_exception(struct dm_exception_table *et, chunk_t chunk) | /* Return the exception data for a sector, or NULL if not remapped. */
static struct dm_exception* dm_lookup_exception(struct dm_exception_table *et, chunk_t chunk) | {
struct list_head *slot;
struct dm_exception *e;
slot = &et->table[exception_hash(et, chunk)];
list_for_each_entry (e, slot, hash_list)
if (chunk >= e->old_chunk &&
chunk <= e->old_chunk + dm_consecutive_chunk_count(e))
return e;
return NULL;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Opens an endpoint of the Low Level Driver. */ | USBD_StatusTypeDef USBD_LL_OpenEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint8_t ep_type, uint16_t ep_mps) | /* Opens an endpoint of the Low Level Driver. */
USBD_StatusTypeDef USBD_LL_OpenEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint8_t ep_type, uint16_t ep_mps) | {
HAL_PCD_EP_Open(pdev->pData, ep_addr, ep_mps, ep_type);
return USBD_OK;
} | STMicroelectronics/STM32CubeF4 | C++ | Other | 789 |
/* Forces or releases High Speed APB (APB2) peripheral reset. */ | void RCC_APB2PeriphResetCmd(u32 apb2_periph, FunctionalState state) | /* Forces or releases High Speed APB (APB2) peripheral reset. */
void RCC_APB2PeriphResetCmd(u32 apb2_periph, FunctionalState state) | {
(state) ? (RCC->APB2RSTR |= apb2_periph) : (RCC->APB2RSTR &= ~apb2_periph);
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Create a handle for the first ACPI opcode in an ACPI system description table. */ | EFI_STATUS SdtOpenSdtTable(IN UINTN TableKey, OUT EFI_ACPI_HANDLE *Handle) | /* Create a handle for the first ACPI opcode in an ACPI system description table. */
EFI_STATUS SdtOpenSdtTable(IN UINTN TableKey, OUT EFI_ACPI_HANDLE *Handle) | {
EFI_ACPI_TABLE_INSTANCE *AcpiTableInstance;
EFI_STATUS Status;
EFI_ACPI_TABLE_LIST *Table;
EFI_AML_HANDLE *AmlHandle;
AcpiTableInstance = SdtGetAcpiTableInstance ();
Status = FindTableByHandle (
TableKey,
&AcpiTableInstance->TableList,
&Table
);
if (EFI_ERROR (Status)) {
return EFI_NOT_FOUND;
}
AmlHandle = AllocatePool (sizeof (*AmlHandle));
ASSERT (AmlHandle != NULL);
AmlHandle->Signature = EFI_AML_ROOT_HANDLE_SIGNATURE;
AmlHandle->Buffer = (VOID *)((UINTN)Table->Table + sizeof (EFI_ACPI_SDT_HEADER));
AmlHandle->Size = Table->Table->Length - sizeof (EFI_ACPI_SDT_HEADER);
AmlHandle->AmlByteEncoding = NULL;
AmlHandle->Modified = FALSE;
*Handle = (EFI_ACPI_HANDLE)AmlHandle;
return EFI_SUCCESS;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Reads the Least significant byte of the 9-bit CAN Transmit Error Counter. */ | uint8_t CAN_ReadLSBTxErrorCounter(void) | /* Reads the Least significant byte of the 9-bit CAN Transmit Error Counter. */
uint8_t CAN_ReadLSBTxErrorCounter(void) | {
uint8_t counter=0;
counter = CAN->ERRSTS_B.TXERRCNT;
return counter;
} | pikasTech/PikaPython | C++ | MIT License | 1,403 |
/* Find out available slot in transfer list of a UFS device. */ | EFI_STATUS UfsFindAvailableSlotInTrl(IN UFS_PASS_THRU_PRIVATE_DATA *Private, OUT UINT8 *Slot) | /* Find out available slot in transfer list of a UFS device. */
EFI_STATUS UfsFindAvailableSlotInTrl(IN UFS_PASS_THRU_PRIVATE_DATA *Private, OUT UINT8 *Slot) | {
UINT8 Nutrs;
UINT8 Index;
UINT32 Data;
EFI_STATUS Status;
ASSERT ((Private != NULL) && (Slot != NULL));
Status = UfsMmioRead32 (Private, UFS_HC_UTRLDBR_OFFSET, &Data);
if (EFI_ERROR (Status)) {
return Status;
}
Nutrs = (UINT8)((Private->UfsHcInfo.Capabilities & UFS_HC_CAP_NUTRS) + 1);
for (Index = 0; Index < Nutrs; Index++) {
if ((Data & (BIT0 << Index)) == 0) {
*Slot = Index;
return EFI_SUCCESS;
}
}
return EFI_NOT_READY;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Enables the events that can cause an ADC trigger event. */ | void TimerADCEventSet(uint32_t ui32Base, uint32_t ui32ADCEvent) | /* Enables the events that can cause an ADC trigger event. */
void TimerADCEventSet(uint32_t ui32Base, uint32_t ui32ADCEvent) | {
ASSERT(_TimerBaseValid(ui32Base));
HWREG(ui32Base + TIMER_O_ADCEV) = ui32ADCEvent;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* leave DFU mode and reset device to jump to user loaded code */ | static void dfu_mode_leave(usb_dev *udev) | /* leave DFU mode and reset device to jump to user loaded code */
static void dfu_mode_leave(usb_dev *udev) | {
usbd_dfu_handler *dfu = (usbd_dfu_handler *)udev->dev.class_data[USBD_DFU_INTERFACE];
dfu->manifest_state = MANIFEST_COMPLETE;
if (dfu_config_desc.dfu_func.bmAttributes & 0x04U) {
dfu->bState = STATE_DFU_MANIFEST_SYNC;
} else {
dfu->bState = STATE_DFU_MANIFEST_WAIT_RESET;
dfu_mal_deinit();
NVIC_SystemReset();
}
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* done - retire a request; caller blocked irqs */ | static void done(struct pxa25x_ep *ep, struct pxa25x_request *req, int status) | /* done - retire a request; caller blocked irqs */
static void done(struct pxa25x_ep *ep, struct pxa25x_request *req, int status) | {
unsigned stopped = ep->stopped;
list_del_init(&req->queue);
if (likely (req->req.status == -EINPROGRESS))
req->req.status = status;
else
status = req->req.status;
if (status && status != -ESHUTDOWN)
DBG(DBG_VERBOSE, "complete %s req %p stat %d len %u/%u\n",
ep->ep.name, &req->req, status,
req->req.actual, req->req.length);
ep->stopped = 1;
req->req.complete(&ep->ep, &req->req);
ep->stopped = stopped;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Open 485 mode on the specified UART.
The */ | void UART485Config(unsigned long ulBase, unsigned long ulBaud, unsigned long ul485Config, unsigned long ulUARTConfig) | /* Open 485 mode on the specified UART.
The */
void UART485Config(unsigned long ulBase, unsigned long ulBaud, unsigned long ul485Config, unsigned long ulUARTConfig) | {
xASSERT(UARTBaseValid(ulBase));
UARTConfigSetExpClk(ulBase, ulBaud, ulUARTConfig);
UARTEnable485(ulBase);
if(ul485Config & UART_ALT_CSR_RS485_NMM)
{
xHWREG(ulBase + UART_FCR) |= UART_FCR_RX_DIS;
}
xHWREG(ulBase + UART_LIN_BCNT) &= 0xFFFFFFFF;
xHWREG(ulBase + UART_LIN_BCNT) |= ul485Config;
} | coocox/cox | C++ | Berkeley Software Distribution (BSD) | 104 |
/* Returns TRUE if this function destroyed the current instance of #CRSelector, FALSE otherwise. */ | gboolean cr_selector_unref(CRSelector *a_this) | /* Returns TRUE if this function destroyed the current instance of #CRSelector, FALSE otherwise. */
gboolean cr_selector_unref(CRSelector *a_this) | {
g_return_val_if_fail (a_this, FALSE);
if (a_this->ref_count) {
a_this->ref_count--;
}
if (a_this->ref_count == 0) {
cr_selector_destroy (a_this);
return TRUE;
}
return FALSE;
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Message: DisplayPromptStatusMessage Opcode: 0x0112 Type: CallControl Direction: pbx2dev VarLength: no */ | static void handle_DisplayPromptStatusMessage(ptvcursor_t *cursor, packet_info *pinfo _U_) | /* Message: DisplayPromptStatusMessage Opcode: 0x0112 Type: CallControl Direction: pbx2dev VarLength: no */
static void handle_DisplayPromptStatusMessage(ptvcursor_t *cursor, packet_info *pinfo _U_) | {
ptvcursor_add(cursor, hf_skinny_timeOutValue, 4, ENC_LITTLE_ENDIAN);
dissect_skinny_displayLabel(cursor, hf_skinny_promptStatus, 32);
si->lineId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
ptvcursor_add(cursor, hf_skinny_lineInstance, 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);
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* This code gets the pointer to the variable name. */ | CHAR16* GetVariableNamePtr(IN VARIABLE_HEADER *Variable, IN BOOLEAN AuthFlag) | /* This code gets the pointer to the variable name. */
CHAR16* GetVariableNamePtr(IN VARIABLE_HEADER *Variable, IN BOOLEAN AuthFlag) | {
return (CHAR16 *)((UINTN)Variable + GetVariableHeaderSize (AuthFlag));
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Fills each CMP_OutputTypeDef member with its default value. */ | void CMP_OutputStructInit(CMP_OutputTypeDef *InitStruct) | /* Fills each CMP_OutputTypeDef member with its default value. */
void CMP_OutputStructInit(CMP_OutputTypeDef *InitStruct) | {
InitStruct->DebSel = CMP_OUTPUT_DEB;
InitStruct->OutputSel = DISABLE;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Atomic addition primitive.
is atomically added to the value at <target>, placing the result at <target>, and the old value from <target> is returned. */ | atomic_val_t atomic_add(atomic_t *target, atomic_val_t value) | /* Atomic addition primitive.
is atomically added to the value at <target>, placing the result at <target>, and the old value from <target> is returned. */
atomic_val_t atomic_add(atomic_t *target, atomic_val_t value) | {
unsigned int key;
atomic_val_t ret;
key = irq_lock();
ret = *target;
*target += value;
irq_unlock(key);
return ret;
} | alibaba/AliOS-Things | C++ | Apache License 2.0 | 4,536 |
/* The KS8695 datasheet prohibits anything other than 32bit accesses to the IO registers, so all our configuration must be done with 32bit operations, and the correct bit masking and shifting. */ | static int ks8695_pci_readconfig(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value) | /* The KS8695 datasheet prohibits anything other than 32bit accesses to the IO registers, so all our configuration must be done with 32bit operations, and the correct bit masking and shifting. */
static int ks8695_pci_readconfig(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value) | {
ks8695_pci_setupconfig(bus->number, devfn, where);
*value = __raw_readl(KS8695_PCI_VA + KS8695_PBCD);
switch (size) {
case 4:
break;
case 2:
*value = *value >> ((where & 2) * 8);
*value &= 0xffff;
break;
case 1:
*value = *value >> ((where & 3) * 8);
*value &= 0xff;
break;
}
if (pci_cfg_dbg) {
printk("read: %d,%08x,%02x,%d: %08x (%08x)\n",
bus->number, devfn, where, size, *value,
__raw_readl(KS8695_PCI_VA + KS8695_PBCD));
}
return PCIBIOS_SUCCESSFUL;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* At present, this routine just applies a system reset. */ | void ppc4xx_reset_system(char *cmd) | /* At present, this routine just applies a system reset. */
void ppc4xx_reset_system(char *cmd) | {
mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) | DBCR0_RST_SYSTEM);
while (1)
;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* The Stop operation removes all key material from PUF flipflops and PUF SRAM, and sets PUF to the Stopped state. */ | status_t PUF_Stop(PUF_Type *base) | /* The Stop operation removes all key material from PUF flipflops and PUF SRAM, and sets PUF to the Stopped state. */
status_t PUF_Stop(PUF_Type *base) | {
status_t status = kStatus_Fail;
if (0x0u == (base->AR & PUF_AR_ALLOW_STOP_MASK))
{
return kStatus_PUF_OperationNotAllowed;
}
base->CR = PUF_CR_STOP_MASK;
while (0u != (base->CR & PUF_CR_STOP_MASK))
{
}
while (0u != (base->SR & PUF_SR_BUSY_MASK))
{
}
status = puf_makeStatus(base, kPUF_Stop);
return status;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Attribute read call back for the Long descriptor V2D1 attribute. */ | static ssize_t read_long_des_v2d1(struct bt_conn *conn, const struct bt_gatt_attr *attr, void *buf, uint16_t len, uint16_t offset) | /* Attribute read call back for the Long descriptor V2D1 attribute. */
static ssize_t read_long_des_v2d1(struct bt_conn *conn, const struct bt_gatt_attr *attr, void *buf, uint16_t len, uint16_t offset) | {
const uint8_t *value = attr->user_data;
return bt_gatt_attr_read(conn, attr, buf, len, offset, value,
sizeof(long_des_v2d1_value));
} | zephyrproject-rtos/zephyr | C++ | Apache License 2.0 | 9,573 |
/* Adds a constant offset to a floating-point vector. */ | void arm_offset_f64(const float64_t *pSrc, float64_t offset, float64_t *pDst, uint32_t blockSize) | /* Adds a constant offset to a floating-point vector. */
void arm_offset_f64(const float64_t *pSrc, float64_t offset, float64_t *pDst, uint32_t blockSize) | {
uint32_t blkCnt;
blkCnt = blockSize;
while (blkCnt > 0U)
{
*pDst++ = (*pSrc++) + offset;
blkCnt--;
}
} | STMicroelectronics/STM32CubeF4 | C++ | Other | 789 |
/* Convenience function to find a node and return it's property or a default value if it doesn't exist. */ | u32 fdt_getprop_u32_default(void *fdt, const char *path, const char *prop, const u32 dflt) | /* Convenience function to find a node and return it's property or a default value if it doesn't exist. */
u32 fdt_getprop_u32_default(void *fdt, const char *path, const char *prop, const u32 dflt) | {
const u32 *val;
int off;
off = fdt_path_offset(fdt, path);
if (off < 0)
return dflt;
val = fdt_getprop(fdt, off, prop, NULL);
if (val)
return *val;
else
return dflt;
} | EmcraftSystems/u-boot | C++ | Other | 181 |
/* volume_sysfs_close - close sysfs for a volume. @vol: volume description object */ | static void volume_sysfs_close(struct ubi_volume *vol) | /* volume_sysfs_close - close sysfs for a volume. @vol: volume description object */
static void volume_sysfs_close(struct ubi_volume *vol) | {
device_remove_file(&vol->dev, &attr_vol_upd_marker);
device_remove_file(&vol->dev, &attr_vol_data_bytes);
device_remove_file(&vol->dev, &attr_vol_usable_eb_size);
device_remove_file(&vol->dev, &attr_vol_alignment);
device_remove_file(&vol->dev, &attr_vol_corrupted);
device_remove_file(&vol->dev, &attr_vol_name);
device_remove_file(&vol->dev, &attr_vol_type);
device_remove_file(&vol->dev, &attr_vol_reserved_ebs);
device_unregister(&vol->dev);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* param base ENET peripheral base address. param ISRHandler The handler to install. */ | void ENET_SetISRHandler(ENET_Type *base, enet_isr_t ISRHandler) | /* param base ENET peripheral base address. param ISRHandler The handler to install. */
void ENET_SetISRHandler(ENET_Type *base, enet_isr_t ISRHandler) | {
s_enetIsr = ISRHandler;
(void)EnableIRQ(s_enetIrqId[ENET_GetInstance(base)]);
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Checks whether the specified EXTI line is asserted or not. */ | ITStatus EXTI_GetITStatus(uint32_t EXTI_Line) | /* Checks whether the specified EXTI line is asserted or not. */
ITStatus EXTI_GetITStatus(uint32_t EXTI_Line) | {
ITStatus bitstatus = RESET;
assert_param(IS_GET_EXTI_LINE(EXTI_Line));
if ((*(__IO uint32_t *) (((uint32_t) &(EXTI->PR)) + ((EXTI_Line) >> 5 ) * 0x20)& (uint32_t)(1 << (EXTI_Line & 0x1F))) != (uint32_t)RESET)
{
bitstatus = SET;
}
else
{
bitstatus = RESET;
}
return bitstatus;
} | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* This function removes all the Wrap datas in the RcvdDgramQue. */ | VOID Udp4FlushRcvdDgram(IN UDP4_INSTANCE_DATA *Instance) | /* This function removes all the Wrap datas in the RcvdDgramQue. */
VOID Udp4FlushRcvdDgram(IN UDP4_INSTANCE_DATA *Instance) | {
UDP4_RXDATA_WRAP *Wrap;
while (!IsListEmpty (&Instance->RcvdDgramQue)) {
Wrap = NET_LIST_HEAD (&Instance->RcvdDgramQue, UDP4_RXDATA_WRAP, Link);
Udp4RecycleRxDataWrap (NULL, (VOID *)Wrap);
}
} | tianocore/edk2 | C++ | Other | 4,240 |
/* TIM_Base MSP De-Initialization This function freeze the hardware resources used in this example. */ | void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef *htim_base) | /* TIM_Base MSP De-Initialization This function freeze the hardware resources used in this example. */
void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef *htim_base) | {
if(htim_base->Instance==TIM11)
{
__HAL_RCC_TIM11_CLK_DISABLE();
}
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Helper function to get the node that a specific item in the list belongs to. */ | static tTbxListNode * TbxListFindListNode(tTbxList const *list, void const *item) | /* Helper function to get the node that a specific item in the list belongs to. */
static tTbxListNode * TbxListFindListNode(tTbxList const *list, void const *item) | {
tTbxListNode * result = NULL;
tTbxListNode * currentListNodePtr;
TBX_ASSERT(list != NULL);
TBX_ASSERT(item != NULL);
if ( (list != NULL) && (item != NULL) )
{
TbxCriticalSectionEnter();
currentListNodePtr = list->firstNodePtr;
while (currentListNodePtr != NULL)
{
if (currentListNodePtr->itemPtr == item)
{
result = currentListNodePtr;
break;
}
currentListNodePtr = currentListNodePtr->nextNodePtr;
}
TbxCriticalSectionExit();
}
return result;
} | feaser/openblt | C++ | GNU General Public License v3.0 | 601 |
/* Update the current system clock. This function will be invoked, when system clock has changed. */ | static void cmu_clock_update(uint32_t clock) | /* Update the current system clock. This function will be invoked, when system clock has changed. */
static void cmu_clock_update(uint32_t clock) | {
__system_clock = clock;
if (clock > 1000000)
ald_tick_init(TICK_INT_PRIORITY);
return;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Called very early, MMU is off, device-tree isn't unflattened */ | static int __init mpc5121_ads_probe(void) | /* Called very early, MMU is off, device-tree isn't unflattened */
static int __init mpc5121_ads_probe(void) | {
unsigned long root = of_get_flat_dt_root();
return of_flat_dt_is_compatible(root, "fsl,mpc5121ads");
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* ETH MSP De-Initialization This function freeze the hardware resources used in this example. */ | void HAL_ETH_MspDeInit(ETH_HandleTypeDef *heth) | /* ETH MSP De-Initialization This function freeze the hardware resources used in this example. */
void HAL_ETH_MspDeInit(ETH_HandleTypeDef *heth) | {
if(heth->Instance==ETH)
{
__HAL_RCC_ETH_CLK_DISABLE();
HAL_GPIO_DeInit(GPIOC, GPIO_PIN_1|GPIO_PIN_4|GPIO_PIN_5);
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_7);
HAL_GPIO_DeInit(GPIOB, GPIO_PIN_13);
HAL_GPIO_DeInit(GPIOG, GPIO_PIN_11|GPIO_PIN_13);
}
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* omap_dev_ready - calls the platform specific dev_ready function @mtd: MTD device structure */ | static int omap_dev_ready(struct mtd_info *mtd) | /* omap_dev_ready - calls the platform specific dev_ready function @mtd: MTD device structure */
static int omap_dev_ready(struct mtd_info *mtd) | {
struct omap_nand_info *info = container_of(mtd, struct omap_nand_info,
mtd);
unsigned int val = __raw_readl(info->gpmc_baseaddr + GPMC_IRQ_STATUS);
if ((val & 0x100) == 0x100) {
val |= 0x100;
val &= ~(0x0);
__raw_writel(val, info->gpmc_baseaddr + GPMC_IRQ_STATUS);
} else {
unsigned int cnt = 0;
while (cnt++ < 0x1FF) {
if ((val & 0x100) == 0x100)
return 0;
val = __raw_readl(info->gpmc_baseaddr +
GPMC_IRQ_STATUS);
}
}
return 1;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Writes and returns a new value to CR2. This function is only available on IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64. */ | UINTN EFIAPI AsmWriteCr2(UINTN Cr2) | /* Writes and returns a new value to CR2. This function is only available on IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64. */
UINTN EFIAPI AsmWriteCr2(UINTN Cr2) | {
__asm__ __volatile__ (
"movl %0, %%cr2"
:
: "r" (Cr2)
);
return Cr2;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Emit a SETLIST instruction. 'base' is register that keeps table; 'nelems' is #table plus those to be stored now; 'tostore' is number of values (in registers 'base + 1',...) to add to table (or LUA_MULTRET to add up to stack top). */ | void luaK_setlist(FuncState *fs, int base, int nelems, int tostore) | /* Emit a SETLIST instruction. 'base' is register that keeps table; 'nelems' is #table plus those to be stored now; 'tostore' is number of values (in registers 'base + 1',...) to add to table (or LUA_MULTRET to add up to stack top). */
void luaK_setlist(FuncState *fs, int base, int nelems, int tostore) | {
luaK_codeABC(fs, OP_SETLIST, base, b, 0);
codeextraarg(fs, c);
}
else
luaX_syntaxerror(fs->ls, "constructor too long");
fs->freereg = base + 1;
} | nodemcu/nodemcu-firmware | C++ | MIT License | 7,566 |
/* fcoe_ctlr_recv_work() - Worker thread function for receiving FIP frames @recv_work: Handle to a FCoE controller */ | static void fcoe_ctlr_recv_work(struct work_struct *) | /* fcoe_ctlr_recv_work() - Worker thread function for receiving FIP frames @recv_work: Handle to a FCoE controller */
static void fcoe_ctlr_recv_work(struct work_struct *) | {
struct fcoe_ctlr *fip;
struct sk_buff *skb;
fip = container_of(recv_work, struct fcoe_ctlr, recv_work);
while ((skb = skb_dequeue(&fip->fip_recv_list)))
fcoe_ctlr_recv_handler(fip, skb);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Dequeues and wakes up one thread from the queue, if any. */ | void osalThreadDequeueNextI(threads_queue_t *tqp, msg_t msg) | /* Dequeues and wakes up one thread from the queue, if any. */
void osalThreadDequeueNextI(threads_queue_t *tqp, msg_t msg) | {
queue_elem_t *e;
osalDbgCheck(tqp != NULL);
if (!ThreadsQueueIsEmpty(tqp))
{
e = ThreadsQueuePop(tqp);
osalThreadResumeI(&e->tr, msg);
}
} | nanoframework/nf-interpreter | C++ | MIT License | 293 |
/* Returns the frequency of different on chip clocks. */ | void RCC_GetClocksFreq(RCC_ClocksTypeDef *clk) | /* Returns the frequency of different on chip clocks. */
void RCC_GetClocksFreq(RCC_ClocksTypeDef *clk) | {
u8 tbADCPresc[] = {2, 4, 6, 8};
clk->SYSCLK_Frequency = RCC_GetSysClockFreq();
clk->HCLK_Frequency = RCC_GetHCLKFreq();
clk->PCLK1_Frequency = RCC_GetPCLK1Freq();
clk->PCLK2_Frequency = RCC_GetPCLK2Freq();
clk->ADCCLK_Frequency = clk->PCLK2_Frequency / tbADCPresc[(RCC->CFGR & ADC_CFGR_PRE) >> ADC_CFGR_PRE_Pos];
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* 'load_cb()' - Set the type of child nodes. */ | static mxml_type_t load_cb(mxml_node_t *node) | /* 'load_cb()' - Set the type of child nodes. */
static mxml_type_t load_cb(mxml_node_t *node) | {
if (!strcmp(node->value.element.name, "description"))
return (MXML_OPAQUE);
else
return (MXML_TEXT);
} | DC-SWAT/DreamShell | C++ | null | 404 |
/* Since typical flash erasable sectors are much larger than what Linux's buffer cache can handle, we must implement read-modify-write on flash sectors for each block write requests. To avoid over-erasing flash sectors and to speed things up, we locally cache a whole flash sector while it is being written to until a different sector is required. */ | static void erase_callback(struct erase_info *done) | /* Since typical flash erasable sectors are much larger than what Linux's buffer cache can handle, we must implement read-modify-write on flash sectors for each block write requests. To avoid over-erasing flash sectors and to speed things up, we locally cache a whole flash sector while it is being written to until a different sector is required. */
static void erase_callback(struct erase_info *done) | {
wait_queue_head_t *wait_q = (wait_queue_head_t *)done->priv;
wake_up(wait_q);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Bump the subclass so xfs_lock_inodes() acquires each lock with a different value */ | static int xfs_lock_inumorder(int lock_mode, int subclass) | /* Bump the subclass so xfs_lock_inodes() acquires each lock with a different value */
static int xfs_lock_inumorder(int lock_mode, int subclass) | {
if (lock_mode & (XFS_IOLOCK_SHARED|XFS_IOLOCK_EXCL))
lock_mode |= (subclass + XFS_LOCK_INUMORDER) << XFS_IOLOCK_SHIFT;
if (lock_mode & (XFS_ILOCK_SHARED|XFS_ILOCK_EXCL))
lock_mode |= (subclass + XFS_LOCK_INUMORDER) << XFS_ILOCK_SHIFT;
return lock_mode;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Register the Kinetis-specific FLEXCAN devices with the kernel */ | void __init kinetis_flexcan_init(void) | /* Register the Kinetis-specific FLEXCAN devices with the kernel */
void __init kinetis_flexcan_init(void) | {
flexcan_data.clock_frequency = kinetis_clock_get(CLOCK_PCLK);
kinetis_flexcan_register(KINETIS_FLEXCAN0_BASE,
KINETIS_FLEXCAN0_IRQ, KINETIS_CG_FLEXCAN0, 0);
kinetis_flexcan_register(KINETIS_FLEXCAN1_BASE,
KINETIS_FLEXCAN1_IRQ, KINETIS_CG_FLEXCAN1, 1);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Finds and returns the version of the driver specified by TheHandle. */ | UINT32 ReturnDriverVersion(IN CONST EFI_HANDLE TheHandle) | /* Finds and returns the version of the driver specified by TheHandle. */
UINT32 ReturnDriverVersion(IN CONST EFI_HANDLE TheHandle) | {
EFI_DRIVER_BINDING_PROTOCOL *DriverBinding;
EFI_STATUS Status;
UINT32 RetVal;
RetVal = (UINT32)-1;
Status = gBS->OpenProtocol ((EFI_HANDLE)TheHandle, &gEfiDriverBindingProtocolGuid, (VOID **)&DriverBinding, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
if (!EFI_ERROR (Status)) {
RetVal = DriverBinding->Version;
gBS->CloseProtocol (TheHandle, &gEfiDriverBindingProtocolGuid, gImageHandle, NULL);
}
return (RetVal);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* sys_ccu_cpu - Set the freq of cpu @freq: freq want to set */ | void __startup sys_ccu_cpu(uint32_t dto, uint32_t freq) | /* sys_ccu_cpu - Set the freq of cpu @freq: freq want to set */
void __startup sys_ccu_cpu(uint32_t dto, uint32_t freq) | {
return dto_freq_set(12, dto, freq);
} | xboot/xboot | C++ | MIT License | 779 |
/* Take a 32 bit variable in parameters and returns a value between 0 and 255. */ | static uint8_t clip32_to_8(int32_t i) | /* Take a 32 bit variable in parameters and returns a value between 0 and 255. */
static uint8_t clip32_to_8(int32_t i) | {
if (i > 255) {
return 255;
}
if (i < 0) {
return 0;
}
return (uint8_t)i;
} | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* Command response callback function for sd_ble_uuid_vs_add BLE command.
Callback for decoding the output parameters and the command response return code. */ | static uint32_t uuid_vs_add_rsp_dec(const uint8_t *p_buffer, uint16_t length) | /* Command response callback function for sd_ble_uuid_vs_add BLE command.
Callback for decoding the output parameters and the command response return code. */
static uint32_t uuid_vs_add_rsp_dec(const uint8_t *p_buffer, uint16_t length) | {
uint32_t result_code;
const uint32_t err_code = ble_uuid_vs_add_rsp_dec(p_buffer,
length,
(uint8_t * *)&mp_out_params[0],
&result_code);
APP_ERROR_CHECK(err_code);
return result_code;
} | labapart/polymcu | C++ | null | 201 |
/* Called by fcs/port to notify transition to offline state. */ | void bfa_fcs_port_n2n_offline(struct bfa_fcs_port_s *port) | /* Called by fcs/port to notify transition to offline state. */
void bfa_fcs_port_n2n_offline(struct bfa_fcs_port_s *port) | {
struct bfa_fcs_port_n2n_s *n2n_port = &port->port_topo.pn2n;
bfa_trc(port->fcs, port->pid);
port->pid = 0;
n2n_port->rem_port_wwn = 0;
n2n_port->reply_oxid = 0;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* switches off rx irq by masking them out in the GHIINTnMSK register */ | static void spider_net_rx_irq_off(struct spider_net_card *card) | /* switches off rx irq by masking them out in the GHIINTnMSK register */
static void spider_net_rx_irq_off(struct spider_net_card *card) | {
u32 regvalue;
regvalue = SPIDER_NET_INT0_MASK_VALUE & (~SPIDER_NET_RXINT);
spider_net_write_reg(card, SPIDER_NET_GHIINT0MSK, regvalue);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Description: This function checks the SECMARK reference counter to see if any SECMARK targets are currently configured, if the reference counter is greater than zero SECMARK is considered to be enabled. Returns true (1) if SECMARK is enabled, false (0) if SECMARK is disabled. */ | static int selinux_secmark_enabled(void) | /* Description: This function checks the SECMARK reference counter to see if any SECMARK targets are currently configured, if the reference counter is greater than zero SECMARK is considered to be enabled. Returns true (1) if SECMARK is enabled, false (0) if SECMARK is disabled. */
static int selinux_secmark_enabled(void) | {
return (atomic_read(&selinux_secmark_refcount) > 0);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Emit code for comparisons. 'e1' was already put in R/K form by 'luaK_infix'. */ | static void codecomp(FuncState *fs, BinOpr opr, expdesc *e1, expdesc *e2) | /* Emit code for comparisons. 'e1' was already put in R/K form by 'luaK_infix'. */
static void codecomp(FuncState *fs, BinOpr opr, expdesc *e1, expdesc *e2) | {
case OPR_NE: {
e1->u.info = condjump(fs, OP_EQ, 0, rk1, rk2);
break;
}
case OPR_GT: case OPR_GE: {
OpCode op = cast(OpCode, (opr - OPR_NE) + OP_EQ);
e1->u.info = condjump(fs, op, 1, rk2, rk1);
break;
}
default: {
OpCode op = cast(OpCode, (opr - OPR_EQ) + OP_EQ);
e1->u.info = condjump(fs, op, 1, rk1, rk2);
break;
}
}
e1->k = VJMP;
} | nodemcu/nodemcu-firmware | C++ | MIT License | 7,566 |
/* Set the callback for the Device Policy Manager policy change notify. */ | void usbc_set_policy_cb_notify(const struct device *dev, const policy_cb_notify_t policy_cb_notify) | /* Set the callback for the Device Policy Manager policy change notify. */
void usbc_set_policy_cb_notify(const struct device *dev, const policy_cb_notify_t policy_cb_notify) | {
struct usbc_port_data *data = dev->data;
data->policy_cb_notify = policy_cb_notify;
} | zephyrproject-rtos/zephyr | C++ | Apache License 2.0 | 9,573 |
/* Return the profiling data set for a given node. This can either be the original profiling data structure or a duplicate (also called "ghost") in case the associated object file has been unloaded. */ | static struct gcov_info* get_node_info(struct gcov_node *node) | /* Return the profiling data set for a given node. This can either be the original profiling data structure or a duplicate (also called "ghost") in case the associated object file has been unloaded. */
static struct gcov_info* get_node_info(struct gcov_node *node) | {
if (node->info)
return node->info;
return node->ghost;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Based on omap_phy_internal.c code from Linux by Hema HK */ | void am35x_musb_reset(struct udevice *dev) | /* Based on omap_phy_internal.c code from Linux by Hema HK */
void am35x_musb_reset(struct udevice *dev) | {
clrsetbits_le32(&am35x_scm_general_regs->ip_sw_reset,
0, USBOTGSS_SW_RST);
clrsetbits_le32(&am35x_scm_general_regs->ip_sw_reset,
USBOTGSS_SW_RST, 0);
} | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* reset the XGXS (between serdes and IBC). Slightly less intrusive than resetting the IBC or external link state, and useful in some cases to cause some retraining. To do this right, we reset IBC as well. */ | static void ipath_pe_xgxs_reset(struct ipath_devdata *dd) | /* reset the XGXS (between serdes and IBC). Slightly less intrusive than resetting the IBC or external link state, and useful in some cases to cause some retraining. To do this right, we reset IBC as well. */
static void ipath_pe_xgxs_reset(struct ipath_devdata *dd) | {
u64 val, prev_val;
prev_val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_xgxsconfig);
val = prev_val | INFINIPATH_XGXS_RESET;
prev_val &= ~INFINIPATH_XGXS_RESET;
ipath_write_kreg(dd, dd->ipath_kregs->kr_control,
dd->ipath_control & ~INFINIPATH_C_LINKENABLE);
ipath_write_kreg(dd, dd->ipath_kregs->kr_xgxsconfig, val);
ipath_read_kreg32(dd, dd->ipath_kregs->kr_scratch);
ipath_write_kreg(dd, dd->ipath_kregs->kr_xgxsconfig, prev_val);
ipath_write_kreg(dd, dd->ipath_kregs->kr_control,
dd->ipath_control);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Receive an arp request from the device layer. */ | static int arp_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev) | /* Receive an arp request from the device layer. */
static int arp_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev) | {
struct arphdr *arp;
if (!pskb_may_pull(skb, arp_hdr_len(dev)))
goto freeskb;
arp = arp_hdr(skb);
if (arp->ar_hln != dev->addr_len ||
dev->flags & IFF_NOARP ||
skb->pkt_type == PACKET_OTHERHOST ||
skb->pkt_type == PACKET_LOOPBACK ||
arp->ar_pln != 4)
goto freeskb;
if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL)
goto out_of_mem;
memset(NEIGH_CB(skb), 0, sizeof(struct neighbour_cb));
return NF_HOOK(NFPROTO_ARP, NF_ARP_IN, skb, dev, NULL, arp_process);
freeskb:
kfree_skb(skb);
out_of_mem:
return 0;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Message: PortCloseMessage Opcode: 0x014c Type: MediaControl Direction: pbx2dev VarLength: no */ | static void handle_PortCloseMessage(ptvcursor_t *cursor, packet_info *pinfo _U_) | /* Message: PortCloseMessage Opcode: 0x014c Type: MediaControl Direction: pbx2dev VarLength: no */
static void handle_PortCloseMessage(ptvcursor_t *cursor, packet_info *pinfo _U_) | {
ptvcursor_add(cursor, hf_skinny_conferenceID, 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_passThruPartyID, 4, ENC_LITTLE_ENDIAN);
ptvcursor_add(cursor, hf_skinny_mediaType, 4, ENC_LITTLE_ENDIAN);
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* If the requested operation results in an overflow or an underflow condition, then Result is set to INTN_ERROR and RETURN_BUFFER_TOO_SMALL is returned. */ | RETURN_STATUS EFIAPI SafeIntnSub(IN INTN Minuend, IN INTN Subtrahend, OUT INTN *Result) | /* If the requested operation results in an overflow or an underflow condition, then Result is set to INTN_ERROR and RETURN_BUFFER_TOO_SMALL is returned. */
RETURN_STATUS EFIAPI SafeIntnSub(IN INTN Minuend, IN INTN Subtrahend, OUT INTN *Result) | {
return SafeInt64ToIntn (((INT64)Minuend) - ((INT64)Subtrahend), Result);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Encode the scancode, 0xe0 prefix, and high bit into a single integer, keeping kernel 2.4 compatibility for set 2 */ | static unsigned int atkbd_compat_scancode(struct atkbd *atkbd, unsigned int code) | /* Encode the scancode, 0xe0 prefix, and high bit into a single integer, keeping kernel 2.4 compatibility for set 2 */
static unsigned int atkbd_compat_scancode(struct atkbd *atkbd, unsigned int code) | {
if (atkbd->set == 3) {
if (atkbd->emul == 1)
code |= 0x100;
} else {
code = (code & 0x7f) | ((code & 0x80) << 1);
if (atkbd->emul == 1)
code |= 0x80;
}
return code;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Refresh an area if there is no Virtual Display Buffer */ | static void lv_refr_area_no_vdb(const lv_area_t *area_p) | /* Refresh an area if there is no Virtual Display Buffer */
static void lv_refr_area_no_vdb(const lv_area_t *area_p) | {
lv_obj_t * top_p;
top_p = lv_refr_get_top_obj(area_p, lv_scr_act());
lv_refr_obj_and_children(top_p, area_p);
lv_refr_obj_and_children(lv_layer_top(), area_p);
lv_refr_obj_and_children(lv_layer_sys(), area_p);
} | RavenSystem/esp-homekit-devices | C++ | Other | 2,577 |
/* Common low-level hardware init for omap1. This should only get called from board specific init. */ | void __init omap1_init_common_hw(void) | /* Common low-level hardware init for omap1. This should only get called from board specific init. */
void __init omap1_init_common_hw(void) | {
omap_writew(0x0, MPU_PUBLIC_TIPB_CNTL);
omap_writew(0x0, MPU_PRIVATE_TIPB_CNTL);
omap1_clk_init();
omap1_mux_init();
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* When running on a device supporting extended PWM fault handling, the fault interrupts are derived by performing a logical OR of each of the configured fault trigger signals for a given generator. Therefore, these interrupts are not directly related to the four possible FAULTn inputs to the device but indicate that a fault has been signaled to one of the four possible PWM generators. On a device without extended PWM fault handling, the interrupt is directly related to the state of the single FAULT pin. */ | void PWMFaultIntClearExt(uint32_t ui32Base, uint32_t ui32FaultInts) | /* When running on a device supporting extended PWM fault handling, the fault interrupts are derived by performing a logical OR of each of the configured fault trigger signals for a given generator. Therefore, these interrupts are not directly related to the four possible FAULTn inputs to the device but indicate that a fault has been signaled to one of the four possible PWM generators. On a device without extended PWM fault handling, the interrupt is directly related to the state of the single FAULT pin. */
void PWMFaultIntClearExt(uint32_t ui32Base, uint32_t ui32FaultInts) | {
ASSERT((ui32Base == PWM0_BASE) || (ui32Base == PWM1_BASE));
ASSERT((ui32FaultInts & ~(PWM_INT_FAULT0 | PWM_INT_FAULT1 |
PWM_INT_FAULT2 | PWM_INT_FAULT3)) == 0);
HWREG(ui32Base + PWM_O_ISC) = ui32FaultInts;
} | feaser/openblt | C++ | GNU General Public License v3.0 | 601 |
/* Obtains the item that is located at the start of the list. Note that the item is just read, not removed. */ | void* TbxListGetFirstItem(tTbxList const *list) | /* Obtains the item that is located at the start of the list. Note that the item is just read, not removed. */
void* TbxListGetFirstItem(tTbxList const *list) | {
void * result = NULL;
TBX_ASSERT(list != NULL);
if (list != NULL)
{
TbxCriticalSectionEnter();
if (list->firstNodePtr != NULL)
{
result = list->firstNodePtr->itemPtr;
}
TbxCriticalSectionExit();
}
return result;
} | feaser/openblt | C++ | GNU General Public License v3.0 | 601 |
/* Stops the Low Level portion of the Device driver. */ | USBD_StatusTypeDef USBD_LL_Stop(USBD_HandleTypeDef *pdev) | /* Stops the Low Level portion of the Device driver. */
USBD_StatusTypeDef USBD_LL_Stop(USBD_HandleTypeDef *pdev) | {
HAL_PCD_Stop(pdev->pData);
return USBD_OK;
} | STMicroelectronics/STM32CubeF4 | C++ | Other | 789 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.