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 routine is invoked to disable the PCI device that is common to all PCI devices. */
static void lpfc_disable_pci_dev(struct lpfc_hba *phba)
/* This routine is invoked to disable the PCI device that is common to all PCI devices. */ static void lpfc_disable_pci_dev(struct lpfc_hba *phba)
{ struct pci_dev *pdev; int bars; if (!phba->pcidev) return; else pdev = phba->pcidev; bars = pci_select_bars(pdev, IORESOURCE_MEM); pci_release_selected_regions(pdev, bars); pci_disable_device(pdev); pci_set_drvdata(pdev, NULL); return; }
robutest/uclinux
C++
GPL-2.0
60
/* Forces the output 1 waveform to active or inactive level. */
void TMR_ConfigForcedOC1(TMR_T *tmr, TMR_FORCED_ACTION_T forcesAction)
/* Forces the output 1 waveform to active or inactive level. */ void TMR_ConfigForcedOC1(TMR_T *tmr, TMR_FORCED_ACTION_T forcesAction)
{ tmr->CCM1_COMPARE_B.OC1MOD = forcesAction; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Refer to EMMC Electrical Standard Spec 5.1 Section 6.6.8 and SD Host Controller Simplified Spec 3.0 Figure 2-29 for details. */
EFI_STATUS EmmcSwitchToHighSpeed(IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_SD_MMC_PASS_THRU_PROTOCOL *PassThru, IN UINT8 Slot, IN UINT16 Rca, IN SD_MMC_BUS_SETTINGS *BusMode)
/* Refer to EMMC Electrical Standard Spec 5.1 Section 6.6.8 and SD Host Controller Simplified Spec 3.0 Figure 2-29 for details. */ EFI_STATUS EmmcSwitchToHighSpeed(IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_SD_MMC_PASS_THRU_PROTOCOL *PassThru, IN UINT8 Slot, IN UINT16 Rca, IN SD_MMC_BUS_SETTINGS *BusMode)
{ EFI_STATUS Status; BOOLEAN IsDdr; if (((BusMode->BusTiming != SdMmcMmcHsSdr) && (BusMode->BusTiming != SdMmcMmcHsDdr) && (BusMode->BusTiming != SdMmcMmcLegacy)) || (BusMode->ClockFreq > 52)) { return EFI_INVALID_PARAMETER; } if (BusMode->BusTiming == SdMmcMmcHsDdr) { IsDdr = TRUE; } else { IsDdr = FALSE; } Status = EmmcSwitchBusWidth (PciIo, PassThru, Slot, Rca, IsDdr, BusMode->BusWidth); if (EFI_ERROR (Status)) { return Status; } return EmmcSwitchBusTiming (PciIo, PassThru, Slot, Rca, BusMode->DriverStrength, BusMode->BusTiming, BusMode->ClockFreq); }
tianocore/edk2
C++
Other
4,240
/* Stops the TIMER Base generation in interrupt mode. */
void ald_timer_base_stop_by_it(ald_timer_handle_t *hperh)
/* Stops the TIMER Base generation in interrupt mode. */ void ald_timer_base_stop_by_it(ald_timer_handle_t *hperh)
{ assert_param(IS_TIMER_INSTANCE(hperh->perh)); ald_timer_interrupt_config(hperh, ALD_TIMER_IT_UPDATE, DISABLE); ALD_TIMER_DISABLE(hperh); return; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Returns the clock source used as LPUART clock. */
uint32_t RCC_GetLPUARTClkSrc(void)
/* Returns the clock source used as LPUART clock. */ uint32_t RCC_GetLPUARTClkSrc(void)
{ return ((uint32_t)(RCC->RDCTRL & RDCTRL_LPUARTCLKSEL_MASK)); }
pikasTech/PikaPython
C++
MIT License
1,403
/* The caller is responsible for decrementing the reference count if found. */
struct ipath_mcast* ipath_mcast_find(union ib_gid *mgid)
/* The caller is responsible for decrementing the reference count if found. */ struct ipath_mcast* ipath_mcast_find(union ib_gid *mgid)
{ struct rb_node *n; unsigned long flags; struct ipath_mcast *mcast; spin_lock_irqsave(&mcast_lock, flags); n = mcast_tree.rb_node; while (n) { int ret; mcast = rb_entry(n, struct ipath_mcast, rb_node); ret = memcmp(mgid->raw, mcast->mgid.raw, sizeof(union ib_gid)); if (ret < 0) n = n->rb_left; else if (ret > 0) n = n->rb_right; else { atomic_inc(&mcast->refcount); spin_unlock_irqrestore(&mcast_lock, flags); goto bail; } } spin_unlock_irqrestore(&mcast_lock, flags); mcast = NULL; bail: return mcast; }
robutest/uclinux
C++
GPL-2.0
60
/* Timer callback for fdb aging, called once per second */
static void bridgeif_age_tmr(void *arg)
/* Timer callback for fdb aging, called once per second */ static void bridgeif_age_tmr(void *arg)
{ bridgeif_dfdb_t *fdb = (bridgeif_dfdb_t *)arg; LWIP_ASSERT("invalid arg", arg != NULL); bridgeif_fdb_age_one_second(fdb); sys_timeout(BRIDGEIF_AGE_TIMER_MS, bridgeif_age_tmr, arg); }
ua1arn/hftrx
C++
null
69
/* strspn - Calculate the length of the initial substring of @s which only contain letters in @accept @s: The string to be searched @accept: The string to search for */
size_t strspn(const char *s, const char *accept)
/* strspn - Calculate the length of the initial substring of @s which only contain letters in @accept @s: The string to be searched @accept: The string to search for */ size_t strspn(const char *s, const char *accept)
{ const char *p; const char *a; size_t count = 0; for (p = s; *p != '\0'; ++p) { for (a = accept; *a != '\0'; ++a) { if (*p == *a) break; } if (*a == '\0') return count; ++count; } return count; }
robutest/uclinux
C++
GPL-2.0
60
/* Get mode number according to column and row */
VOID GetConsoleOutMode(IN BMM_CALLBACK_DATA *CallbackData)
/* Get mode number according to column and row */ VOID GetConsoleOutMode(IN BMM_CALLBACK_DATA *CallbackData)
{ UINTN Col; UINTN Row; UINTN CurrentCol; UINTN CurrentRow; UINTN Mode; UINTN MaxMode; EFI_STATUS Status; EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *ConOut; ConOut = gST->ConOut; MaxMode = (UINTN)(ConOut->Mode->MaxMode); CurrentCol = PcdGet32 (PcdSetupConOutColumn); CurrentRow = PcdGet32 (PcdSetupConOutRow); for (Mode = 0; Mode < MaxMode; Mode++) { Status = ConOut->QueryMode (ConOut, Mode, &Col, &Row); if (!EFI_ERROR (Status)) { if ((CurrentCol == Col) && (CurrentRow == Row)) { CallbackData->BmmFakeNvData.ConsoleOutMode = (UINT16)Mode; break; } } } }
tianocore/edk2
C++
Other
4,240
/* Example: Use "/v1/Systems/Bios" to build a RedPath to address the "Bios" resource for this computer system. */
CHAR8* EFIAPI RedfishBuildPathWithSystemUuid(IN CONST CHAR8 *RedPath, IN BOOLEAN FromSmbios, IN CHAR8 *IdString OPTIONAL)
/* Example: Use "/v1/Systems/Bios" to build a RedPath to address the "Bios" resource for this computer system. */ CHAR8* EFIAPI RedfishBuildPathWithSystemUuid(IN CONST CHAR8 *RedPath, IN BOOLEAN FromSmbios, IN CHAR8 *IdString OPTIONAL)
{ UINTN BufSize; CHAR8 *RetRedPath; EFI_GUID SystemUuid; EFI_STATUS Status; if (RedPath == NULL) { return NULL; } if (FromSmbios) { Status = NetLibGetSystemGuid (&SystemUuid); if (EFI_ERROR (Status)) { return NULL; } BufSize = AsciiStrSize (RedPath) + AsciiStrLen ("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"); } else { BufSize = AsciiStrSize (RedPath) + AsciiStrLen (IdString); } RetRedPath = AllocateZeroPool (BufSize); if (RetRedPath == NULL) { return NULL; } if (FromSmbios) { AsciiSPrint (RetRedPath, BufSize, RedPath, &SystemUuid); } else { AsciiSPrint (RetRedPath, BufSize, RedPath, IdString); } return RetRedPath; }
tianocore/edk2
C++
Other
4,240
/* Non-FMP instance to register one ESRT entry into ESRT Cache. */
EFI_STATUS EFIAPI EsrtDxeRegisterEsrtEntry(IN EFI_SYSTEM_RESOURCE_ENTRY *Entry)
/* Non-FMP instance to register one ESRT entry into ESRT Cache. */ EFI_STATUS EFIAPI EsrtDxeRegisterEsrtEntry(IN EFI_SYSTEM_RESOURCE_ENTRY *Entry)
{ EFI_STATUS Status; EFI_SYSTEM_RESOURCE_ENTRY EsrtEntryTmp; if (Entry == NULL) { return EFI_INVALID_PARAMETER; } Status = EfiAcquireLockOrFail (&mPrivate.NonFmpLock); if (EFI_ERROR (Status)) { return Status; } Status = GetEsrtEntry ( &Entry->FwClass, ESRT_FROM_NONFMP, &EsrtEntryTmp ); if (Status == EFI_NOT_FOUND) { Status = InsertEsrtEntry (Entry, ESRT_FROM_NONFMP); } EfiReleaseLock (&mPrivate.NonFmpLock); return Status; }
tianocore/edk2
C++
Other
4,240
/* Write the initialization vector (for the CBC, CFB, OFB & CTR cipher modes) */
void aes_write_initvector(struct aes_dev_inst *const dev_inst, const uint32_t *p_vector)
/* Write the initialization vector (for the CBC, CFB, OFB & CTR cipher modes) */ void aes_write_initvector(struct aes_dev_inst *const dev_inst, const uint32_t *p_vector)
{ uint32_t i; for (i = 0; i < 4; i++) { dev_inst->hw_dev->AESA_INITVECT[i].AESA_INITVECT = *p_vector; p_vector++; } }
remotemcu/remcu-chip-sdks
C++
null
436
/* Set the contents of a G_TYPE_BOXED derived #GValue to @v_boxed. The boxed value is assumed to be static, and is thus not duplicated when setting the #GValue. */
void g_value_set_static_boxed(GValue *value, gconstpointer boxed)
/* Set the contents of a G_TYPE_BOXED derived #GValue to @v_boxed. The boxed value is assumed to be static, and is thus not duplicated when setting the #GValue. */ void g_value_set_static_boxed(GValue *value, gconstpointer boxed)
{ g_return_if_fail (G_VALUE_HOLDS_BOXED (value)); g_return_if_fail (G_TYPE_IS_VALUE (G_VALUE_TYPE (value))); value_set_boxed_internal (value, boxed, FALSE, FALSE); }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* Return the number of PPC cores on this SOC. */
__weak int cpu_numcores(void)
/* Return the number of PPC cores on this SOC. */ __weak int cpu_numcores(void)
{ struct cpu_type *cpu = gd->arch.cpu; if (cpu->num_cores == 0) return hweight32(cpu_mask()); return cpu->num_cores; }
4ms/stm32mp1-baremetal
C++
Other
137
/* Initializes a #GHookList. This must be called before the #GHookList is used. */
void g_hook_list_init(GHookList *hook_list, guint hook_size)
/* Initializes a #GHookList. This must be called before the #GHookList is used. */ void g_hook_list_init(GHookList *hook_list, guint hook_size)
{ g_return_if_fail (hook_list != NULL); g_return_if_fail (hook_size >= sizeof (GHook)); hook_list->seq_id = 1; hook_list->hook_size = hook_size; hook_list->is_setup = TRUE; hook_list->hooks = NULL; hook_list->dummy3 = NULL; hook_list->finalize_hook = default_finalize_hook; hook_list->dummy[0] = NULL; hook_list->dummy[1] = NULL; }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* Return: 0 if all went fine, else return appropriate error. */
static int ti_sci_cmd_dev_is_on(const struct ti_sci_handle *handle, u32 id, bool *r_state, bool *curr_state)
/* Return: 0 if all went fine, else return appropriate error. */ static int ti_sci_cmd_dev_is_on(const struct ti_sci_handle *handle, u32 id, bool *r_state, bool *curr_state)
{ int ret; u8 p_state, c_state; if (!r_state && !curr_state) return -EINVAL; ret = ti_sci_get_device_state(handle, id, NULL, NULL, &p_state, &c_state); if (ret) return ret; if (r_state) *r_state = (p_state == MSG_DEVICE_SW_STATE_ON); if (curr_state) *curr_state = (c_state == MSG_DEVICE_HW_STATE_ON); return 0; }
4ms/stm32mp1-baremetal
C++
Other
137
/* If Security2Handler is NULL, then ASSERT(). If no enough resources available to register new handler, then ASSERT(). If AuthenticationOperation is not recongnized, then ASSERT(). If AuthenticationOperation is EFI_AUTH_OPERATION_NONE, then ASSERT(). If the previous register handler can't be executed before the later register handler, then ASSERT(). */
EFI_STATUS EFIAPI RegisterSecurity2Handler(IN SECURITY2_FILE_AUTHENTICATION_HANDLER Security2Handler, IN UINT32 AuthenticationOperation)
/* If Security2Handler is NULL, then ASSERT(). If no enough resources available to register new handler, then ASSERT(). If AuthenticationOperation is not recongnized, then ASSERT(). If AuthenticationOperation is EFI_AUTH_OPERATION_NONE, then ASSERT(). If the previous register handler can't be executed before the later register handler, then ASSERT(). */ EFI_STATUS EFIAPI RegisterSecurity2Handler(IN SECURITY2_FILE_AUTHENTICATION_HANDLER Security2Handler, IN UINT32 AuthenticationOperation)
{ EFI_STATUS Status; ASSERT (Security2Handler != NULL); ASSERT (CheckAuthentication2Operation (mCurrentAuthOperation2, AuthenticationOperation)); mCurrentAuthOperation2 = mCurrentAuthOperation2 | AuthenticationOperation; if (mNumberOfSecurity2Handler == mMaxNumberOfSecurity2Handler) { Status = ReallocateSecurity2HandlerTable (); ASSERT_EFI_ERROR (Status); } mSecurity2Table[mNumberOfSecurity2Handler].Security2Operation = AuthenticationOperation; mSecurity2Table[mNumberOfSecurity2Handler].Security2Handler = Security2Handler; mNumberOfSecurity2Handler++; return EFI_SUCCESS; }
tianocore/edk2
C++
Other
4,240
/* de-initialize the host pipes used for the HID class */
void usbh_hid_itf_deinit(usbh_host *puhost)
/* de-initialize the host pipes used for the HID class */ void usbh_hid_itf_deinit(usbh_host *puhost)
{ usbh_hid_handler *hid = (usbh_hid_handler *)puhost->active_class->class_data; if (0x00U != hid->pipe_in) { usb_pipe_halt (puhost->data, hid->pipe_in); usbh_pipe_free (puhost->data, hid->pipe_in); hid->pipe_in = 0U; } if (0x00U != hid->pipe_out) { usb_pipe_halt (puhost->data, hid->pipe_out); usbh_pipe_free (puhost->data, hid->pipe_out); hid->pipe_out = 0U; } }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Copy contents of colormap from @from to @to. */
int fb_copy_cmap(const struct fb_cmap *from, struct fb_cmap *to)
/* Copy contents of colormap from @from to @to. */ int fb_copy_cmap(const struct fb_cmap *from, struct fb_cmap *to)
{ int tooff = 0, fromoff = 0; int size; if (to->start > from->start) fromoff = to->start - from->start; else tooff = from->start - to->start; size = to->len - tooff; if (size > (int) (from->len - fromoff)) size = from->len - fromoff; if (size <= 0) return -EINVAL; size *= sizeof(u16); memcpy(to->red+tooff, from->red+fromoff, size); memcpy(to->green+tooff, from->green+fromoff, size); memcpy(to->blue+tooff, from->blue+fromoff, size); if (from->transp && to->transp) memcpy(to->transp+tooff, from->transp+fromoff, size); return 0; }
robutest/uclinux
C++
GPL-2.0
60
/* The name pointer in @hl has to stay valid at all times because the string is not copied. */
void hpsb_register_highlevel(struct hpsb_highlevel *hl)
/* The name pointer in @hl has to stay valid at all times because the string is not copied. */ void hpsb_register_highlevel(struct hpsb_highlevel *hl)
{ unsigned long flags; hpsb_init_highlevel(hl); INIT_LIST_HEAD(&hl->addr_list); down_write(&hl_drivers_sem); list_add_tail(&hl->hl_list, &hl_drivers); up_write(&hl_drivers_sem); write_lock_irqsave(&hl_irqs_lock, flags); list_add_tail(&hl->irq_list, &hl_irqs); write_unlock_irqrestore(&hl_irqs_lock, flags); if (hl->add_host) nodemgr_for_each_host(hl, highlevel_for_each_host_reg); return; }
robutest/uclinux
C++
GPL-2.0
60
/* Airpcap wrapper, used to store the current settings for the selected adapter */
gboolean airpcap_if_store_cur_config_as_adapter_default(PAirpcapHandle ah)
/* Airpcap wrapper, used to store the current settings for the selected adapter */ gboolean airpcap_if_store_cur_config_as_adapter_default(PAirpcapHandle ah)
{ if (!AirpcapLoaded) return FALSE; return g_PAirpcapStoreCurConfigAsAdapterDefault(ah); }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* Turn a tracing stop into a normal stop now, since with no tracer there would be no way to wake it up with SIGCONT or SIGKILL. If there was a signal sent that would resume the child, but didn't because it was in TASK_TRACED, resume it now. Requires that irqs be disabled. */
static void ptrace_untrace(struct task_struct *child)
/* Turn a tracing stop into a normal stop now, since with no tracer there would be no way to wake it up with SIGCONT or SIGKILL. If there was a signal sent that would resume the child, but didn't because it was in TASK_TRACED, resume it now. Requires that irqs be disabled. */ static void ptrace_untrace(struct task_struct *child)
{ spin_lock(&child->sighand->siglock); if (task_is_traced(child)) { if (child->signal->flags & SIGNAL_STOP_STOPPED || child->signal->group_stop_count) __set_task_state(child, TASK_STOPPED); else signal_wake_up(child, 1); } spin_unlock(&child->sighand->siglock); }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Sets the accelerometer sample rate in the IMU_SensorFusion structure. */
void IMU_fuseAccelerometerSetSampleRate(IMU_SensorFusion *f, float rate)
/* Sets the accelerometer sample rate in the IMU_SensorFusion structure. */ void IMU_fuseAccelerometerSetSampleRate(IMU_SensorFusion *f, float rate)
{ f->gSampleRate = rate; return; }
remotemcu/remcu-chip-sdks
C++
null
436
/* Returns the clock source for the specified timer module. */
uint32_t TimerClockSourceGet(uint32_t ui32Base)
/* Returns the clock source for the specified timer module. */ uint32_t TimerClockSourceGet(uint32_t ui32Base)
{ ASSERT(_TimerBaseValid(ui32Base)); return(HWREG(ui32Base + TIMER_O_CC)); }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Disables detection of pause frames with stations unicast address. When disabled GMAC only detects with the unique multicast address (802.3x). */
void synopGMAC_unicast_pause_frame_detect_disable(synopGMACdevice *gmacdev)
/* Disables detection of pause frames with stations unicast address. When disabled GMAC only detects with the unique multicast address (802.3x). */ void synopGMAC_unicast_pause_frame_detect_disable(synopGMACdevice *gmacdev)
{ synopGMACClearBits(gmacdev -> MacBase, GmacFlowControl, GmacUnicastPauseFrame); return; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Absolute Wrist Tilt threshold register(r/w). Absolute wrist tilt threshold parameters. 1 LSB = 15.625 mg.Default value: 20h (500 mg).. */
int32_t lsm6dsl_tilt_threshold_set(stmdev_ctx_t *ctx, uint8_t *buff)
/* Absolute Wrist Tilt threshold register(r/w). Absolute wrist tilt threshold parameters. 1 LSB = 15.625 mg.Default value: 20h (500 mg).. */ int32_t lsm6dsl_tilt_threshold_set(stmdev_ctx_t *ctx, uint8_t *buff)
{ int32_t ret; ret = lsm6dsl_mem_bank_set(ctx, LSM6DSL_BANK_B); if(ret == 0){ ret = lsm6dsl_write_reg(ctx, LSM6DSL_A_WRIST_TILT_THS, buff, 1); if(ret == 0){ ret = lsm6dsl_mem_bank_set(ctx, LSM6DSL_USER_BANK); } } return ret; }
eclipse-threadx/getting-started
C++
Other
310
/* Disable Snapshot for messages relevant to Master. When disabled, snapshot is taken for messages relevant to slave node. Valid only for Ordinary clock and Boundary clock Reserved when "Advanced Time Stamp" is not selected */
void synopGMAC_TS_master_disable(synopGMACdevice *gmacdev)
/* Disable Snapshot for messages relevant to Master. When disabled, snapshot is taken for messages relevant to slave node. Valid only for Ordinary clock and Boundary clock Reserved when "Advanced Time Stamp" is not selected */ void synopGMAC_TS_master_disable(synopGMACdevice *gmacdev)
{ synopGMACClearBits(gmacdev->MacBase, GmacTSControl, GmacTSMSTRENA); return; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Recycles the bus number, and unlinks the controller from usbcore data structures so that it won't be seen by scanning the bus list. */
static void usb_deregister_bus(struct usb_bus *bus)
/* Recycles the bus number, and unlinks the controller from usbcore data structures so that it won't be seen by scanning the bus list. */ static void usb_deregister_bus(struct usb_bus *bus)
{ dev_info (bus->controller, "USB bus %d deregistered\n", bus->busnum); mutex_lock(&usb_bus_list_lock); list_del (&bus->bus_list); mutex_unlock(&usb_bus_list_lock); usb_notify_remove_bus(bus); clear_bit (bus->busnum, busmap.busmap); }
robutest/uclinux
C++
GPL-2.0
60
/* Encode a point. This method assumes that the point is correct and is not the point at infinity. Encoded size is always 1+2*plen, where plen is the field modulus length, in bytes. */
static void point_encode(void *dst, const jacobian *P, const curve_params *cc)
/* Encode a point. This method assumes that the point is correct and is not the point at infinity. Encoded size is always 1+2*plen, where plen is the field modulus length, in bytes. */ static void point_encode(void *dst, const jacobian *P, const curve_params *cc)
{ unsigned char *buf; uint32_t xbl; size_t plen; jacobian Q, T; buf = dst; xbl = cc->p[0]; xbl -= (xbl >> 5); plen = (xbl + 7) >> 3; buf[0] = 0x04; memcpy(&Q, P, sizeof *P); set_one(T.c[2], cc->p); run_code(&Q, &T, cc, code_affine); br_i31_encode(buf + 1, plen, Q.c[0]); br_i31_encode(buf + 1 + plen, plen, Q.c[1]); }
RavenSystem/esp-homekit-devices
C++
Other
2,577
/* USB Device Interrupt enable Called by USBD_Init to enable the USB Interrupt Return Value: None */
void USBD_IntrEna(void)
/* USB Device Interrupt enable Called by USBD_Init to enable the USB Interrupt Return Value: None */ void USBD_IntrEna(void)
{ NVIC_EnableIRQ(USB0_IRQn); }
ARMmbed/DAPLink
C++
Apache License 2.0
2,140
/* Prints a unicode string to the default console, at the supplied cursor position, using L"%s" format. */
UINTN EFIAPI PrintStringAtWithWidth(IN UINTN Column, IN UINTN Row, IN CHAR16 *String, IN UINTN Width)
/* Prints a unicode string to the default console, at the supplied cursor position, using L"%s" format. */ UINTN EFIAPI PrintStringAtWithWidth(IN UINTN Column, IN UINTN Row, IN CHAR16 *String, IN UINTN Width)
{ return PrintAt (Width, Column, Row, L"%s", String); }
tianocore/edk2
C++
Other
4,240
/* Stalls the CPU for the number of nanoseconds specified by NanoSeconds. */
UINTN EFIAPI NanoSecondDelay(IN UINTN NanoSeconds)
/* Stalls the CPU for the number of nanoseconds specified by NanoSeconds. */ UINTN EFIAPI NanoSecondDelay(IN UINTN NanoSeconds)
{ InternalRiscVTimerDelay ( DivU64x32 ( MultU64x32 ( NanoSeconds, PcdGet64 (PcdCpuCoreCrystalClockFrequency) ), 1000000000u ) ); return NanoSeconds; }
tianocore/edk2
C++
Other
4,240
/* Locate a certain GUID protocol interface in a Handle's protocols. */
STATIC PROTOCOL_INTERFACE* CoreGetProtocolInterface(IN EFI_HANDLE UserHandle, IN EFI_GUID *Protocol)
/* Locate a certain GUID protocol interface in a Handle's protocols. */ STATIC PROTOCOL_INTERFACE* CoreGetProtocolInterface(IN EFI_HANDLE UserHandle, IN EFI_GUID *Protocol)
{ PROTOCOL_ENTRY *ProtEntry; PROTOCOL_INTERFACE *Prot; IHANDLE *Handle; LIST_ENTRY *Link; Handle = (IHANDLE *)UserHandle; for (Link = Handle->Protocols.ForwardLink; Link != &Handle->Protocols; Link = Link->ForwardLink) { Prot = CR (Link, PROTOCOL_INTERFACE, Link, PROTOCOL_INTERFACE_SIGNATURE); ProtEntry = Prot->Protocol; if (CompareGuid (&ProtEntry->ProtocolID, Protocol)) { return Prot; } } return NULL; }
tianocore/edk2
C++
Other
4,240
/* This function assumes to be called rarely. Switching between 8259A registers is slow. This has to be protected by the irq controller spinlock before being called. */
static int i8259A_irq_real(unsigned int irq)
/* This function assumes to be called rarely. Switching between 8259A registers is slow. This has to be protected by the irq controller spinlock before being called. */ static int i8259A_irq_real(unsigned int irq)
{ int value; int irqmask = 1<<irq; if (irq < 8) { outb(0x0B, PIC_MASTER_CMD); value = inb(PIC_MASTER_CMD) & irqmask; outb(0x0A, PIC_MASTER_CMD); return value; } outb(0x0B, PIC_SLAVE_CMD); value = inb(PIC_SLAVE_CMD) & (irqmask >> 8); outb(0x0A, PIC_SLAVE_CMD); return value; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Send a master data transmit request when the master have obtained control of the bus.(Write Step2) For this function returns immediately, it is always using in the interrupt hander. */
void I2CMasterWriteRequestS2(unsigned long ulBase, unsigned char ucData, xtBoolean bEndTransmition)
/* Send a master data transmit request when the master have obtained control of the bus.(Write Step2) For this function returns immediately, it is always using in the interrupt hander. */ void I2CMasterWriteRequestS2(unsigned long ulBase, unsigned char ucData, xtBoolean bEndTransmition)
{ unsigned long ulStatus; xASSERT((ulBase == I2C0_BASE) || (ulBase == I2C1_BASE)); xHWREG(ulBase + I2C_DR) = ucData; if(bEndTransmition) { do { ulStatus = I2CStatusGet(ulBase); if(xHWREG(ulBase + I2C_CSR) & 0x0700) break; } while(!(ulStatus == I2C_MASTER_TX_EMPTY)); I2CStopSend(ulBase); } }
coocox/cox
C++
Berkeley Software Distribution (BSD)
104
/* Locking: must be called within a read rcu section. */
struct mesh_path* mesh_path_lookup_by_idx(int idx, struct ieee80211_sub_if_data *sdata)
/* Locking: must be called within a read rcu section. */ struct mesh_path* mesh_path_lookup_by_idx(int idx, struct ieee80211_sub_if_data *sdata)
{ struct mpath_node *node; struct hlist_node *p; int i; int j = 0; for_each_mesh_entry(mesh_paths, p, node, i) { if (sdata && node->mpath->sdata != sdata) continue; if (j++ == idx) { if (MPATH_EXPIRED(node->mpath)) { spin_lock_bh(&node->mpath->state_lock); if (MPATH_EXPIRED(node->mpath)) node->mpath->flags &= ~MESH_PATH_ACTIVE; spin_unlock_bh(&node->mpath->state_lock); } return node->mpath; } } return NULL; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Check if interface is duplicate (two interfaces on the same subnet) */
static bool _mdns_if_is_dup(tcpip_adapter_if_t tcpip_if)
/* Check if interface is duplicate (two interfaces on the same subnet) */ static bool _mdns_if_is_dup(tcpip_adapter_if_t tcpip_if)
{ tcpip_adapter_if_t other_if = _mdns_get_other_if (tcpip_if); if (other_if == TCPIP_ADAPTER_IF_MAX) { return false; } if (_mdns_server->interfaces[tcpip_if].pcbs[MDNS_IP_PROTOCOL_V4].state == PCB_DUP || _mdns_server->interfaces[tcpip_if].pcbs[MDNS_IP_PROTOCOL_V6].state == PCB_DUP || _mdns_server->interfaces[other_if].pcbs[MDNS_IP_PROTOCOL_V4].state == PCB_DUP || _mdns_server->interfaces[other_if].pcbs[MDNS_IP_PROTOCOL_V6].state == PCB_DUP ) { return true; } return false; }
retro-esp32/RetroESP32
C++
Creative Commons Attribution Share Alike 4.0 International
581
/* Clears the dirty bit and flushes before if necessary. Only call this function when there are no pending requests, it does not guard against concurrent requests dirtying the image. */
static int qcow2_mark_clean(BlockDriverState *bs)
/* Clears the dirty bit and flushes before if necessary. Only call this function when there are no pending requests, it does not guard against concurrent requests dirtying the image. */ static int qcow2_mark_clean(BlockDriverState *bs)
{ BDRVQcowState *s = bs->opaque; if (s->incompatible_features & QCOW2_INCOMPAT_DIRTY) { int ret; s->incompatible_features &= ~QCOW2_INCOMPAT_DIRTY; ret = bdrv_flush(bs); if (ret < 0) { return ret; } return qcow2_update_header(bs); } return 0; }
ve3wwg/teensy3_qemu
C++
Other
15
/* Note that 'init' is a special process: it doesn't get signals it doesn't want to handle. Thus you cannot kill init even with a SIGKILL even by mistake. */
asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs)
/* Note that 'init' is a special process: it doesn't get signals it doesn't want to handle. Thus you cannot kill init even with a SIGKILL even by mistake. */ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs)
{ siginfo_t info; struct k_sigaction ka; int signr; current->thread.esp0 = (unsigned long) regs; if (!oldset) oldset = &current->blocked; signr = get_signal_to_deliver(&info, &ka, regs, NULL); if (signr > 0) { handle_signal(signr, &ka, &info, oldset, regs); return 1; } if (regs->orig_d0 >= 0) handle_restart(regs, NULL, 0); return 0; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Sets the ROSC monitor mode. This function sets the ROSC monitor mode. The mode can be disabled, it can generate an interrupt when the error is disabled, or reset when the error is detected. */
void CLOCK_SetRoscMonitorMode(scg_rosc_monitor_mode_t mode)
/* Sets the ROSC monitor mode. This function sets the ROSC monitor mode. The mode can be disabled, it can generate an interrupt when the error is disabled, or reset when the error is detected. */ void CLOCK_SetRoscMonitorMode(scg_rosc_monitor_mode_t mode)
{ uint32_t reg = SCG0->ROSCCSR; reg &= ~(SCG_ROSCCSR_ROSCCM_MASK | SCG_ROSCCSR_ROSCCMRE_MASK); reg |= (uint32_t)mode; SCG0->ROSCCSR = reg; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Find the correct struct clk for the device and connection ID. We do slightly fuzzy matching here: An entry with a NULL ID is assumed to be a wildcard. If an entry has a device ID, it must match If an entry has a connection ID, it must match Then we take the most specific entry - with the following order of precidence: dev+con > dev only > con only. */
static struct clk* clk_find(const char *dev_id, const char *con_id)
/* Find the correct struct clk for the device and connection ID. We do slightly fuzzy matching here: An entry with a NULL ID is assumed to be a wildcard. If an entry has a device ID, it must match If an entry has a connection ID, it must match Then we take the most specific entry - with the following order of precidence: dev+con > dev only > con only. */ static struct clk* clk_find(const char *dev_id, const char *con_id)
{ struct clk_lookup *p; struct clk *clk = NULL; int match, best = 0; list_for_each_entry(p, &clock_list, node) { match = 0; if (p->dev_id) { if (!dev_id || strcmp(p->dev_id, dev_id)) continue; match += 2; } if (p->con_id) { if (!con_id || strcmp(p->con_id, con_id)) continue; match += 1; } if (match == 0) continue; if (match > best) { clk = p->clk; best = match; } } return clk; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Calculate an alarm value given the alarm temperature. */
int compute_alarm(float alarmTemp)
/* Calculate an alarm value given the alarm temperature. */ int compute_alarm(float alarmTemp)
{ float a = (alarmTemp - s_tempmon.hotTemp); float b = (s_tempmon.hotTemp - ROOM_TEMP); float c = (s_tempmon.roomCount - s_tempmon.hotCount); float d = (b / c); return s_tempmon.hotCount + a / d; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Write arguments. Splice the buffer to be written into the iovec. */
static int nfs3_xdr_writeargs(struct rpc_rqst *req, __be32 *p, struct nfs_writeargs *args)
/* Write arguments. Splice the buffer to be written into the iovec. */ static int nfs3_xdr_writeargs(struct rpc_rqst *req, __be32 *p, struct nfs_writeargs *args)
{ struct xdr_buf *sndbuf = &req->rq_snd_buf; u32 count = args->count; p = xdr_encode_fhandle(p, args->fh); p = xdr_encode_hyper(p, args->offset); *p++ = htonl(count); *p++ = htonl(args->stable); *p++ = htonl(count); sndbuf->len = xdr_adjust_iovec(sndbuf->head, p); xdr_encode_pages(sndbuf, args->pages, args->pgbase, count); sndbuf->flags |= XDRBUF_WRITE; return 0; }
robutest/uclinux
C++
GPL-2.0
60
/* Reads a half-word from the LPC channel pool. */
unsigned short LPCHalfWordRead(unsigned long ulBase, unsigned long ulOffset)
/* Reads a half-word from the LPC channel pool. */ unsigned short LPCHalfWordRead(unsigned long ulBase, unsigned long ulOffset)
{ ASSERT(ulBase == LPC0_BASE); ASSERT((ulOffset & 1) == 0); ASSERT(ulOffset < (((HWREG(ulBase + LPC_O_STS) & LPC_STS_POOLSZ_M) >> 16) * 256)); return(HWREGH(ulBase + LPC_O_POOL + ulOffset)); }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* 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 &= (uint16_t)~((uint16_t)USART_CR3_HDSEL); } }
MaJerle/stm32f429
C++
null
2,036
/* param config Pointer to configuration structure. See to dcdc_config_t. */
void DCDC_GetDefaultConfig(dcdc_config_t *config)
/* param config Pointer to configuration structure. See to dcdc_config_t. */ void DCDC_GetDefaultConfig(dcdc_config_t *config)
{ assert(NULL != config); (void)memset(config, 0, sizeof(*config)); config->controlMode = kDCDC_StaticControl; config->trimInputMode = kDCDC_SampleTrimInput; config->enableDcdcTimeout = false; config->enableSwitchingConverterOutput = false; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* This function is called when the vfs is freeing the superblock. We just need to free our own part. */
static void exofs_put_super(struct super_block *sb)
/* This function is called when the vfs is freeing the superblock. We just need to free our own part. */ static void exofs_put_super(struct super_block *sb)
{ int num_pend; struct exofs_sb_info *sbi = sb->s_fs_info; if (sb->s_dirt) exofs_write_super(sb); for (num_pend = atomic_read(&sbi->s_curr_pending); num_pend > 0; num_pend = atomic_read(&sbi->s_curr_pending)) { wait_queue_head_t wq; init_waitqueue_head(&wq); wait_event_timeout(wq, (atomic_read(&sbi->s_curr_pending) == 0), msecs_to_jiffies(100)); } _exofs_print_device("Unmounting", NULL, sbi->s_ods[0], sbi->s_pid); exofs_free_sbi(sbi); sb->s_fs_info = NULL; }
robutest/uclinux
C++
GPL-2.0
60
/* introduce function I3C_MasterClearFlagsAndEnableIRQ. This function was used of Clear all flags and Enable I3C IRQ sources for */
static void I3C_MasterClearFlagsAndEnableIRQ(I3C_Type *base)
/* introduce function I3C_MasterClearFlagsAndEnableIRQ. This function was used of Clear all flags and Enable I3C IRQ sources for */ static void I3C_MasterClearFlagsAndEnableIRQ(I3C_Type *base)
{ I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); I3C_MasterEnableInterrupts(base, (uint32_t)kMasterIrqFlags); }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* sermouse_disconnect() cleans up after we don't want talk to the mouse anymore. */
static void sermouse_disconnect(struct serio *serio)
/* sermouse_disconnect() cleans up after we don't want talk to the mouse anymore. */ static void sermouse_disconnect(struct serio *serio)
{ struct sermouse *sermouse = serio_get_drvdata(serio); serio_close(serio); serio_set_drvdata(serio, NULL); input_unregister_device(sermouse->dev); kfree(sermouse); }
robutest/uclinux
C++
GPL-2.0
60
/* Returns the CRC Polynomial register value for the specified SPI. */
uint16_t SPI_GetCRCPoly(SPI_Module *SPIx)
/* Returns the CRC Polynomial register value for the specified SPI. */ uint16_t SPI_GetCRCPoly(SPI_Module *SPIx)
{ assert_param(IS_SPI_PERIPH(SPIx)); return SPIx->CRCPOLY; }
pikasTech/PikaPython
C++
MIT License
1,403
/* filemap_flush is used for the block device, so if there is a dirty page for a block already in flight, we will not wait and start the io over again */
int fat_flush_inodes(struct super_block *sb, struct inode *i1, struct inode *i2)
/* filemap_flush is used for the block device, so if there is a dirty page for a block already in flight, we will not wait and start the io over again */ int fat_flush_inodes(struct super_block *sb, struct inode *i1, struct inode *i2)
{ int ret = 0; if (!MSDOS_SB(sb)->options.flush) return 0; if (i1) ret = writeback_inode(i1); if (!ret && i2) ret = writeback_inode(i2); if (!ret) { struct address_space *mapping = sb->s_bdev->bd_inode->i_mapping; ret = filemap_flush(mapping); } return ret; }
robutest/uclinux
C++
GPL-2.0
60
/* Try to lock the provided mutex. Call this function to attempt to lock the mutex before performing a state change Non-Blocking, immediately returns with failure if lock attempt fails */
IoT_Error_t aws_iot_thread_mutex_trylock(IoT_Mutex_t *pMutex)
/* Try to lock the provided mutex. Call this function to attempt to lock the mutex before performing a state change Non-Blocking, immediately returns with failure if lock attempt fails */ IoT_Error_t aws_iot_thread_mutex_trylock(IoT_Mutex_t *pMutex)
{ return SUCCESS; } else { return MUTEX_LOCK_ERROR; } }
retro-esp32/RetroESP32
C++
Creative Commons Attribution Share Alike 4.0 International
581
/* \This function will force the processor enter sleep mode,after operating the action,some clocks will be closed except "Internal 10 kHz low speed oscillator clock". */
void PWRCtlStandby(void)
/* \This function will force the processor enter sleep mode,after operating the action,some clocks will be closed except "Internal 10 kHz low speed oscillator clock". */ void PWRCtlStandby(void)
{ xSysCtlClockSet(50000000, xSYSCTL_XTAL_12MHZ | xSYSCTL_OSC_MAIN); xSysCtlSleep(); }
coocox/cox
C++
Berkeley Software Distribution (BSD)
104
/* Returns CR_OK upon successful completion, an error code otherwise. */
enum CRStatus cr_font_size_copy(CRFontSize *a_dst, CRFontSize *a_src)
/* Returns CR_OK upon successful completion, an error code otherwise. */ enum CRStatus cr_font_size_copy(CRFontSize *a_dst, CRFontSize *a_src)
{ g_return_val_if_fail (a_dst && a_src, CR_BAD_PARAM_ERROR); switch (a_src->type) { case PREDEFINED_ABSOLUTE_FONT_SIZE: case RELATIVE_FONT_SIZE: case INHERITED_FONT_SIZE: cr_font_size_clear (a_dst); memcpy (a_dst, a_src, sizeof (CRFontSize)); break; case ABSOLUTE_FONT_SIZE: cr_font_size_clear (a_dst); cr_num_copy (&a_dst->value.absolute, &a_src->value.absolute); a_dst->type = a_src->type; break; default: return CR_UNKNOWN_TYPE_ERROR; } return CR_OK; }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* Returns the newly instanciated #CRParsingLocation. Must be freed by cr_parsing_location_destroy() */
CRParsingLocation* cr_parsing_location_new(void)
/* Returns the newly instanciated #CRParsingLocation. Must be freed by cr_parsing_location_destroy() */ CRParsingLocation* cr_parsing_location_new(void)
{ CRParsingLocation * result = NULL ; result = g_try_malloc (sizeof (CRParsingLocation)) ; if (!result) { cr_utils_trace_info ("Out of memory error") ; return NULL ; } cr_parsing_location_init (result) ; return result ; }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* Gets the public key component from the established EC context. The Ec context should be correctly initialized by EcNewByNid, and successfully generate key pair from */
BOOLEAN EFIAPI EcGetPubKey(IN OUT VOID *EcContext, OUT UINT8 *PublicKey, IN OUT UINTN *PublicKeySize)
/* Gets the public key component from the established EC context. The Ec context should be correctly initialized by EcNewByNid, and successfully generate key pair from */ BOOLEAN EFIAPI EcGetPubKey(IN OUT VOID *EcContext, OUT UINT8 *PublicKey, IN OUT UINTN *PublicKeySize)
{ CALL_CRYPTO_SERVICE (EcGetPubKey, (EcContext, PublicKey, PublicKeySize), FALSE); }
tianocore/edk2
C++
Other
4,240
/* GUTI reallocation complete No more IE's Identity request */
static void nas_emm_id_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
/* GUTI reallocation complete No more IE's Identity request */ static void nas_emm_id_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len)
{ guint32 curr_offset, bit_offset; guint curr_len; curr_offset = offset; curr_len = len; pinfo->link_dir = P2P_DIR_DL; bit_offset=curr_offset<<3; proto_tree_add_bits_item(tree, hf_nas_eps_emm_spare_half_octet, tvb, bit_offset, 4, ENC_BIG_ENDIAN); bit_offset+=4; proto_tree_add_bits_item(tree, hf_nas_eps_emm_id_type2, tvb, bit_offset, 4, ENC_BIG_ENDIAN); curr_len--; curr_offset++; EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_eps_extraneous_data); }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* Usb hub control transfer to get the hub status. */
EFI_STATUS UsbHubCtrlGetHubStatus(IN USB_DEVICE *HubDev, OUT UINT32 *State)
/* Usb hub control transfer to get the hub status. */ EFI_STATUS UsbHubCtrlGetHubStatus(IN USB_DEVICE *HubDev, OUT UINT32 *State)
{ EFI_STATUS Status; Status = UsbCtrlRequest ( HubDev, EfiUsbDataIn, USB_REQ_TYPE_CLASS, USB_HUB_TARGET_HUB, USB_HUB_REQ_GET_STATUS, 0, 0, State, 4 ); return Status; }
tianocore/edk2
C++
Other
4,240
/* Helper function for exported configuration functions. Configuration access is not atomic, so spinlock to keep drivers from clobbering each other. */
static void pcie_io_conf(pcie_bdf_t bdf, unsigned int reg, bool write, uint32_t *data)
/* Helper function for exported configuration functions. Configuration access is not atomic, so spinlock to keep drivers from clobbering each other. */ static void pcie_io_conf(pcie_bdf_t bdf, unsigned int reg, bool write, uint32_t *data)
{ static struct k_spinlock lock; k_spinlock_key_t k; bdf &= PCIE_X86_CAP_BDF_MASK; bdf |= PCIE_X86_CAP_EN; bdf |= (reg & PCIE_X86_CAP_WORD_MASK) << PCIE_X86_CAP_WORD_SHIFT; k = k_spin_lock(&lock); sys_out32(bdf, PCIE_X86_CAP); if (write) { sys_out32(*data, PCIE_X86_CDP); } else { *data = sys_in32(PCIE_X86_CDP); } sys_out32(0U, PCIE_X86_CAP); k_spin_unlock(&lock, k); }
zephyrproject-rtos/zephyr
C++
Apache License 2.0
9,573
/* Remove one device in the global device list. */
VOID RemoveDevice(IN OPAL_DRIVER_DEVICE *Dev)
/* Remove one device in the global device list. */ VOID RemoveDevice(IN OPAL_DRIVER_DEVICE *Dev)
{ OPAL_DRIVER_DEVICE *TmpDev; if (mOpalDriver.DeviceList == NULL) { return; } if (mOpalDriver.DeviceList == Dev) { mOpalDriver.DeviceList = NULL; return; } TmpDev = mOpalDriver.DeviceList; while (TmpDev->Next != NULL) { if (TmpDev->Next == Dev) { TmpDev->Next = Dev->Next; break; } } }
tianocore/edk2
C++
Other
4,240
/* Waits for a FLASH operation to complete or a TIMEOUT to occur. */
FLASH_Status FLASH_WaitForLastOperation(uint32_t Timeout)
/* Waits for a FLASH operation to complete or a TIMEOUT to occur. */ FLASH_Status FLASH_WaitForLastOperation(uint32_t Timeout)
{ __IO FLASH_Status status = FLASH_COMPLETE; status = FLASH_GetStatus(); while((status == FLASH_BUSY) && (Timeout != 0x00)) { status = FLASH_GetStatus(); Timeout--; } if(Timeout == 0x00 ) { status = FLASH_TIMEOUT; } return status; }
avem-labs/Avem
C++
MIT License
1,752
/* Checks whether the specified ADC flag is set or not. */
FlagStatus ADC_GetFlagStatusNew(ADC_Module *ADCx, uint8_t ADC_FLAG_NEW)
/* Checks whether the specified ADC flag is set or not. */ FlagStatus ADC_GetFlagStatusNew(ADC_Module *ADCx, uint8_t ADC_FLAG_NEW)
{ FlagStatus bitstatus = RESET; assert_param(IsAdcModule(ADCx)); assert_param(IsAdcGetFlag(ADC_FLAG_NEW)); if ((ADCx->CTRL3 & ADC_FLAG_NEW) != (uint8_t)RESET) { bitstatus = SET; } else { bitstatus = RESET; } return bitstatus; }
pikasTech/PikaPython
C++
MIT License
1,403
/* Check to see if the heap guard is enabled for page and/or pool allocation. */
BOOLEAN IsHeapGuardEnabled(VOID)
/* Check to see if the heap guard is enabled for page and/or pool allocation. */ BOOLEAN IsHeapGuardEnabled(VOID)
{ return IsMemoryTypeToGuard ( EfiMaxMemoryType, AllocateAnyPages, GUARD_HEAP_TYPE_POOL|GUARD_HEAP_TYPE_PAGE ); }
tianocore/edk2
C++
Other
4,240
/* Returns: TRUE if the @drive can be ejected, FALSE otherwise. */
gboolean g_drive_can_eject(GDrive *drive)
/* Returns: TRUE if the @drive can be ejected, FALSE otherwise. */ gboolean g_drive_can_eject(GDrive *drive)
{ GDriveIface *iface; g_return_val_if_fail (G_IS_DRIVE (drive), FALSE); iface = G_DRIVE_GET_IFACE (drive); if (iface->can_eject == NULL) return FALSE; return (* iface->can_eject) (drive); }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* Set data transfer width. Possible data transfer width is 1-bit, 4-bits or 8-bits. */
static int mmc_set_bus_width(uint32_t instance, int bus_width)
/* Set data transfer width. Possible data transfer width is 1-bit, 4-bits or 8-bits. */ static int mmc_set_bus_width(uint32_t instance, int bus_width)
{ return mmc_switch(instance, MMC_SWITCH_SETBW_ARG(bus_width)); }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Do AND operation with the value of the specified SD host controller mmio register. */
EFI_STATUS EFIAPI SdPeimHcAndMmio(IN UINTN Address, IN UINT8 Count, IN VOID *AndData)
/* Do AND operation with the value of the specified SD host controller mmio register. */ EFI_STATUS EFIAPI SdPeimHcAndMmio(IN UINTN Address, IN UINT8 Count, IN VOID *AndData)
{ EFI_STATUS Status; UINT64 Data; UINT64 And; Status = SdPeimHcRwMmio (Address, TRUE, Count, &Data); if (EFI_ERROR (Status)) { return Status; } if (Count == 1) { And = *(UINT8 *)AndData; } else if (Count == 2) { And = *(UINT16 *)AndData; } else if (Count == 4) { And = *(UINT32 *)AndData; } else if (Count == 8) { And = *(UINT64 *)AndData; } else { return EFI_INVALID_PARAMETER; } Data &= And; Status = SdPeimHcRwMmio (Address, FALSE, Count, &Data); return Status; }
tianocore/edk2
C++
Other
4,240
/* Set flash wait states in the EFC for 48MHz. */
void BOARD_ConfigureFlash48MHz(void)
/* Set flash wait states in the EFC for 48MHz. */ void BOARD_ConfigureFlash48MHz(void)
{ AT91C_BASE_EFC->EFC_FMR = 6 << 8; }
apopple/Pandaboard-FreeRTOS
C++
null
25
/* Gets an instance of spiflashSizeInfo_t that describes the storage limits of the SPI flash like page size (minimum write size) and sector size (minimum erase size). */
spiflashSizeInfo_t spiflashGetSizeInfo(void)
/* Gets an instance of spiflashSizeInfo_t that describes the storage limits of the SPI flash like page size (minimum write size) and sector size (minimum erase size). */ spiflashSizeInfo_t spiflashGetSizeInfo(void)
{ spiflashSizeInfo_t size; size.pageSize = W25Q16BV_PAGESIZE; size.pageCount = W25Q16BV_PAGES; size.sectorSize = W25Q16BV_SECTORSIZE; size.sectorCount = W25Q16BV_SECTORS; return size; }
microbuilder/LPC1343CodeBase
C++
Other
73
/* Init function for virtio devices are in a single page above top of "normal" mem */
static int __init kvm_devices_init(void)
/* Init function for virtio devices are in a single page above top of "normal" mem */ static int __init kvm_devices_init(void)
{ int rc; if (!MACHINE_IS_KVM) return -ENODEV; kvm_root = root_device_register("kvm_s390"); if (IS_ERR(kvm_root)) { rc = PTR_ERR(kvm_root); printk(KERN_ERR "Could not register kvm_s390 root device"); return rc; } rc = vmem_add_mapping(real_memory_size, PAGE_SIZE); if (rc) { root_device_unregister(kvm_root); return rc; } kvm_devices = (void *) real_memory_size; ctl_set_bit(0, 9); register_external_interrupt(0x2603, kvm_extint_handler); scan_devices(); return 0; }
robutest/uclinux
C++
GPL-2.0
60
/* If Address > 0x0FFFFFFF, then ASSERT(). If Address is not aligned on a 16-bit boundary, then ASSERT(). */
UINT16 EFIAPI PciAnd16(IN UINTN Address, IN UINT16 AndData)
/* If Address > 0x0FFFFFFF, then ASSERT(). If Address is not aligned on a 16-bit boundary, then ASSERT(). */ UINT16 EFIAPI PciAnd16(IN UINTN Address, IN UINT16 AndData)
{ return PciWrite16 (Address, (UINT16)(PciRead16 (Address) & AndData)); }
tianocore/edk2
C++
Other
4,240
/* GFXMMU MSP Initialization This function configures the hardware resources used in this example. */
void HAL_GFXMMU_MspInit(GFXMMU_HandleTypeDef *hgfxmmu)
/* GFXMMU MSP Initialization This function configures the hardware resources used in this example. */ void HAL_GFXMMU_MspInit(GFXMMU_HandleTypeDef *hgfxmmu)
{ if(hgfxmmu->Instance==GFXMMU) { __HAL_RCC_GFXMMU_CLK_ENABLE(); } }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Dissects the Init Event Ack packet specified in Section 2.3.4 */
void dissect_ptpIP_init_event_ack(packet_info *pinfo)
/* Dissects the Init Event Ack packet specified in Section 2.3.4 */ void dissect_ptpIP_init_event_ack(packet_info *pinfo)
{ col_set_str( pinfo->cinfo, COL_INFO, "Init Event Ack"); }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* Enables or disables the read/write protection (PCROP) of the desired sectors, for the first 1 MB of the Flash. */
void FLASH_OB_PCROPConfig(uint32_t OB_PCROP, FunctionalState NewState)
/* Enables or disables the read/write protection (PCROP) of the desired sectors, for the first 1 MB of the Flash. */ void FLASH_OB_PCROPConfig(uint32_t OB_PCROP, FunctionalState NewState)
{ FLASH_Status status = FLASH_COMPLETE; assert_param(IS_OB_PCROP(OB_PCROP)); assert_param(IS_FUNCTIONAL_STATE(NewState)); status = FLASH_WaitForLastOperation(); if(status == FLASH_COMPLETE) { if(NewState != DISABLE) { *(__IO uint16_t*)OPTCR_BYTE2_ADDRESS |= (uint16_t)OB_PCROP; } else { *(__IO uint16_t*)OPTCR_BYTE2_ADDRESS &= (~OB_PCROP); } } }
MaJerle/stm32f429
C++
null
2,036
/* return 1 if the end of file was reached, 0 elsewhere */
int ZEXPORT unzeof(unzFile file)
/* return 1 if the end of file was reached, 0 elsewhere */ int ZEXPORT unzeof(unzFile file)
{ unz_s* s; file_in_zip_read_info_s* pfile_in_zip_read_info; if (file==NULL) return UNZ_PARAMERROR; s=(unz_s*)file; pfile_in_zip_read_info=s->pfile_in_zip_read; if (pfile_in_zip_read_info==NULL) return UNZ_PARAMERROR; if (pfile_in_zip_read_info->rest_read_uncompressed == 0) return 1; else return 0; }
ua1arn/hftrx
C++
null
69
/* Send a master data receive request when the master have obtained control of the bus.(Write Step2) For this function returns immediately, it is always using in the interrupt hander. */
void I2CMasterReadRequestS2(unsigned long ulBase, xtBoolean bEndTransmition)
/* Send a master data receive request when the master have obtained control of the bus.(Write Step2) For this function returns immediately, it is always using in the interrupt hander. */ void I2CMasterReadRequestS2(unsigned long ulBase, xtBoolean bEndTransmition)
{ unsigned long ulStatus; xASSERT((ulBase == I2C0_BASE)); if(bEndTransmition) { xHWREG(ulBase + I2C_CR) &= ~I2C_CR_AA; do { ulStatus = I2CStatusGet(ulBase); if(xHWREG(ulBase + I2C_CSR) & 0x0700) break; } while(!(ulStatus == I2C_MASTER_RX_NOT_EMPTY)); I2CStopSend(ulBase); } }
coocox/cox
C++
Berkeley Software Distribution (BSD)
104
/* Get inquiry mode of the TEL0026 bluetooth module. */
tBtResult BTInqModeGet(char *pBuf)
/* Get inquiry mode of the TEL0026 bluetooth module. */ tBtResult BTInqModeGet(char *pBuf)
{ unsigned char ucRes; *pBuf = 0; ClearRecBuf(); s_cCmdBuffer[0] = 0; BTSendCmdString(BtCmdInqModeGet); if(!BTReadLine(s_cCmdBuffer)) { return BT_ERR_NORESPONSE; } ucRes = BTErrorDecode(s_cCmdBuffer); if(!ucRes) { StrCat(pBuf, s_cCmdBuffer + 6); } return ucRes; }
coocox/cox
C++
Berkeley Software Distribution (BSD)
104
/* RCC Set HSI48 clock source to the PLL. */
void rcc_set_hsi48_source_pll(void)
/* RCC Set HSI48 clock source to the PLL. */ void rcc_set_hsi48_source_pll(void)
{ RCC_CCIPR &= ~RCC_CCIPR_HSI48SEL; }
insane-adding-machines/unicore-mx
C++
GNU General Public License v3.0
50
/* The return value is the rounded version of the @j parameter. */
unsigned long round_jiffies(unsigned long j)
/* The return value is the rounded version of the @j parameter. */ unsigned long round_jiffies(unsigned long j)
{ return round_jiffies_common(j, raw_smp_processor_id(), false); }
EmcraftSystems/linux-emcraft
C++
Other
266
/* UART MSP Initialization This function configures the hardware resources used in this example. */
void HAL_UART_MspInit(UART_HandleTypeDef *huart)
/* UART MSP Initialization This function configures the hardware resources used in this example. */ void HAL_UART_MspInit(UART_HandleTypeDef *huart)
{ GPIO_InitTypeDef GPIO_InitStruct = {0}; if(huart->Instance==USART2) { __HAL_RCC_USART2_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE(); GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_3; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; GPIO_InitStruct.Alternate = GPIO_AF7_USART2; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); } }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Outputs the code length array for the Extra Set or the Position Set. */
VOID WritePTLen(IN INT32 LoopVar8, IN INT32 nbit, IN INT32 Special)
/* Outputs the code length array for the Extra Set or the Position Set. */ VOID WritePTLen(IN INT32 LoopVar8, IN INT32 nbit, IN INT32 Special)
{ INT32 LoopVar1; INT32 LoopVar3; while (LoopVar8 > 0 && mPTLen[LoopVar8 - 1] == 0) { LoopVar8--; } PutBits (nbit, LoopVar8); LoopVar1 = 0; while (LoopVar1 < LoopVar8) { LoopVar3 = mPTLen[LoopVar1++]; if (LoopVar3 <= 6) { PutBits (3, LoopVar3); } else { PutBits (LoopVar3 - 3, (1U << (LoopVar3 - 3)) - 2); } if (LoopVar1 == Special) { while (LoopVar1 < 6 && mPTLen[LoopVar1] == 0) { LoopVar1++; } PutBits (2, (LoopVar1 - 3) & 3); } } }
tianocore/edk2
C++
Other
4,240
/* evaluate_cond_node evaluates the conditional stored in a struct cond_node and if the result is different than the current state of the node it sets the rules in the true/false list appropriately. If the result of the expression is undefined all of the rules are disabled for safety. */
int evaluate_cond_node(struct policydb *p, struct cond_node *node)
/* evaluate_cond_node evaluates the conditional stored in a struct cond_node and if the result is different than the current state of the node it sets the rules in the true/false list appropriately. If the result of the expression is undefined all of the rules are disabled for safety. */ int evaluate_cond_node(struct policydb *p, struct cond_node *node)
{ int new_state; struct cond_av_list *cur; new_state = cond_evaluate_expr(p, node->expr); if (new_state != node->cur_state) { node->cur_state = new_state; if (new_state == -1) printk(KERN_ERR "SELinux: expression result was undefined - disabling all rules.\n"); for (cur = node->true_list; cur; cur = cur->next) { if (new_state <= 0) cur->node->key.specified &= ~AVTAB_ENABLED; else cur->node->key.specified |= AVTAB_ENABLED; } for (cur = node->false_list; cur; cur = cur->next) { if (new_state) cur->node->key.specified &= ~AVTAB_ENABLED; else cur->node->key.specified |= AVTAB_ENABLED; } } return 0; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* If Sha1Context is NULL, then return FALSE. If HashValue is NULL, then return FALSE. If this interface is not supported, then return FALSE. */
BOOLEAN EFIAPI CryptoServiceSha1Final(IN OUT VOID *Sha1Context, OUT UINT8 *HashValue)
/* If Sha1Context is NULL, then return FALSE. If HashValue is NULL, then return FALSE. If this interface is not supported, then return FALSE. */ BOOLEAN EFIAPI CryptoServiceSha1Final(IN OUT VOID *Sha1Context, OUT UINT8 *HashValue)
{ return CALL_BASECRYPTLIB (Sha1.Services.Final, Sha1Final, (Sha1Context, HashValue), FALSE); }
tianocore/edk2
C++
Other
4,240
/* Read whether the specifie DMA Channel flag is set or not. */
uint8_t DMA_ReadStatusFlag(DMA_FLAG_T flag)
/* Read whether the specifie DMA Channel flag is set or not. */ uint8_t DMA_ReadStatusFlag(DMA_FLAG_T flag)
{ if((flag & 0x10000000) != RESET ) { if((DMA2->INTSTS & flag ) != RESET ) { return SET ; } else { return RESET ; } } else { if((DMA1->INTSTS & flag ) != RESET ) { return SET ; } else { return RESET ; } } }
pikasTech/PikaPython
C++
MIT License
1,403
/* zfcp_dbf_rec_unit - trace event for unit state change @id: identifier for trigger of state change additional reference (e.g. request) @unit: unit */
void zfcp_dbf_rec_unit(char *id, void *ref, struct zfcp_unit *unit)
/* zfcp_dbf_rec_unit - trace event for unit state change @id: identifier for trigger of state change additional reference (e.g. request) @unit: unit */ void zfcp_dbf_rec_unit(char *id, void *ref, struct zfcp_unit *unit)
{ struct zfcp_port *port = unit->port; struct zfcp_dbf *dbf = port->adapter->dbf; zfcp_dbf_rec_target(id, ref, dbf, &unit->status, &unit->erp_counter, port->wwpn, port->d_id, unit->fcp_lun); }
robutest/uclinux
C++
GPL-2.0
60
/* Check if the usart receiver is not empty. */
int32_t usart_async_is_rx_not_empty(const struct usart_async_descriptor *const descr)
/* Check if the usart receiver is not empty. */ int32_t usart_async_is_rx_not_empty(const struct usart_async_descriptor *const descr)
{ ASSERT(descr); return ringbuffer_num(&descr->rx) > 0; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Reset the qset structure. the NAPI structure is preserved in the event of the qset's reincarnation, for example during EEH recovery. */
static void t3_reset_qset(struct sge_qset *q)
/* Reset the qset structure. the NAPI structure is preserved in the event of the qset's reincarnation, for example during EEH recovery. */ static void t3_reset_qset(struct sge_qset *q)
{ if (q->adap && !(q->adap->flags & NAPI_INIT)) { memset(q, 0, sizeof(*q)); return; } q->adap = NULL; memset(&q->rspq, 0, sizeof(q->rspq)); memset(q->fl, 0, sizeof(struct sge_fl) * SGE_RXQ_PER_SET); memset(q->txq, 0, sizeof(struct sge_txq) * SGE_TXQ_PER_SET); q->txq_stopped = 0; q->tx_reclaim_timer.function = NULL; q->rx_reclaim_timer.function = NULL; q->nomem = 0; napi_free_frags(&q->napi); }
robutest/uclinux
C++
GPL-2.0
60
/* Initialize the memory map. It is called during the system startup to create static physical to virtual memory map for the IO modules. */
void __init mx21_map_io(void)
/* Initialize the memory map. It is called during the system startup to create static physical to virtual memory map for the IO modules. */ void __init mx21_map_io(void)
{ mxc_set_cpu_type(MXC_CPU_MX21); mxc_arch_reset_init(IO_ADDRESS(WDOG_BASE_ADDR)); iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc)); }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Sets the register in the LCD controller to write commands to. */
static EMSTATUS setNextReg(uint8_t reg)
/* Sets the register in the LCD controller to write commands to. */ static EMSTATUS setNextReg(uint8_t reg)
{ uint16_t data; data = reg & 0xff; *command_register = data; return DMD_OK; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* The helpers below calculate the offset of a given record, key or pointer into a btree block (xfs_btree_*_offset) or return a pointer to the given record, key or pointer (xfs_btree_*_addr). Note that all addressing inside the btree block is done using indices starting at one, not zero! Return size of the btree block header for this btree instance. */
static size_t xfs_btree_block_len(struct xfs_btree_cur *cur)
/* The helpers below calculate the offset of a given record, key or pointer into a btree block (xfs_btree_*_offset) or return a pointer to the given record, key or pointer (xfs_btree_*_addr). Note that all addressing inside the btree block is done using indices starting at one, not zero! Return size of the btree block header for this btree instance. */ static size_t xfs_btree_block_len(struct xfs_btree_cur *cur)
{ return (cur->bc_flags & XFS_BTREE_LONG_PTRS) ? XFS_BTREE_LBLOCK_LEN : XFS_BTREE_SBLOCK_LEN; }
robutest/uclinux
C++
GPL-2.0
60
/* Sets the global configuration for all LPM requests. */
void USBHostLPMConfig(uint32_t ui32Base, uint32_t ui32ResumeTime, uint32_t ui32Config)
/* Sets the global configuration for all LPM requests. */ void USBHostLPMConfig(uint32_t ui32Base, uint32_t ui32ResumeTime, uint32_t ui32Config)
{ ASSERT(ui32Base == USB0_BASE); ASSERT(ui32ResumeTime <= 1175); ASSERT(ui32ResumeTime >= 50); HWREGH(ui32Base + USB_O_LPMATTR) = ui32Config | ((ui32ResumeTime - 50) / 75) << USB_LPMATTR_HIRD_S; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* nilfs_dat_new - create dat file @nilfs: nilfs object @entry_size: size of a dat entry */
struct inode* nilfs_dat_new(struct the_nilfs *nilfs, size_t entry_size)
/* nilfs_dat_new - create dat file @nilfs: nilfs object @entry_size: size of a dat entry */ struct inode* nilfs_dat_new(struct the_nilfs *nilfs, size_t entry_size)
{ static struct lock_class_key dat_lock_key; struct inode *dat; struct nilfs_dat_info *di; int err; dat = nilfs_mdt_new(nilfs, NULL, NILFS_DAT_INO, sizeof(*di)); if (dat) { err = nilfs_palloc_init_blockgroup(dat, entry_size); if (unlikely(err)) { nilfs_mdt_destroy(dat); return NULL; } di = NILFS_DAT_I(dat); lockdep_set_class(&di->mi.mi_sem, &dat_lock_key); nilfs_palloc_setup_cache(dat, &di->palloc_cache); } return dat; }
robutest/uclinux
C++
GPL-2.0
60
/* Sends stop condition on bus. Sends a stop condition on bus. */
void i2c_master_send_stop(struct i2c_master_module *const module)
/* Sends stop condition on bus. Sends a stop condition on bus. */ void i2c_master_send_stop(struct i2c_master_module *const module)
{ Assert(module); Assert(module->hw); I2c *const i2c_module = (module->hw); i2c_wait_for_idle(i2c_module); i2c_module->I2C_ONBUS.reg = I2C_ONBUS_ONBUS_ENABLE_0; }
memfault/zero-to-main
C++
null
200
/* atl1_exit_module is called just before the driver is removed from memory. */
static void __exit atl1_exit_module(void)
/* atl1_exit_module is called just before the driver is removed from memory. */ static void __exit atl1_exit_module(void)
{ pci_unregister_driver(&atl1_driver); }
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)
{ BSP_LED_On(LED_RED); while(1) { } }
STMicroelectronics/STM32CubeF4
C++
Other
789
/* Clear the SPI interrupt flag of the specified SPI port. */
void SPIIntFlagClear(unsigned long ulBase)
/* Clear the SPI interrupt flag of the specified SPI port. */ void SPIIntFlagClear(unsigned long ulBase)
{ xASSERT((ulBase == SPI0_BASE) || (ulBase == SPI1_BASE)); xHWREG(ulBase + SPI_CNTRL) |= SPI_CNTRL_IF; }
coocox/cox
C++
Berkeley Software Distribution (BSD)
104
/* param base LPUART peripheral base address. param handle LPUART handle pointer. param count Receive bytes count. retval kStatus_NoTransferInProgress No receive in progress. retval kStatus_InvalidArgument Parameter is invalid. retval kStatus_Success Get successfully through the parameter */
status_t LPUART_TransferGetReceiveCount(LPUART_Type *base, lpuart_handle_t *handle, uint32_t *count)
/* param base LPUART peripheral base address. param handle LPUART handle pointer. param count Receive bytes count. retval kStatus_NoTransferInProgress No receive in progress. retval kStatus_InvalidArgument Parameter is invalid. retval kStatus_Success Get successfully through the parameter */ status_t LPUART_TransferGetReceiveCount(LPUART_Type *base, lpuart_handle_t *handle, uint32_t *count)
{ assert(NULL != handle); assert(NULL != count); if ((uint8_t)kLPUART_RxIdle == handle->rxState) { return kStatus_NoTransferInProgress; } *count = handle->rxDataSizeAll - handle->rxDataSize; return kStatus_Success; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Calculate the PCD value from the clock rate (in picoseconds). We take account of the PPCR clock setting. */
static unsigned int get_pcd(unsigned int pixclock, unsigned int cpuclock)
/* Calculate the PCD value from the clock rate (in picoseconds). We take account of the PPCR clock setting. */ static unsigned int get_pcd(unsigned int pixclock, unsigned int cpuclock)
{ unsigned int pcd = cpuclock / 100; pcd *= pixclock; pcd /= 10000000; return pcd + 1; }
robutest/uclinux
C++
GPL-2.0
60
/* The node is not changed if it (or its first child) is not a real number node. */
int mxmlSetReal(mxml_node_t *node, double real)
/* The node is not changed if it (or its first child) is not a real number node. */ int mxmlSetReal(mxml_node_t *node, double real)
{ if (node && node->type == MXML_ELEMENT && node->child && node->child->type == MXML_REAL) node = node->child; if (!node || node->type != MXML_REAL) return (-1); node->value.real = real; return (0); }
DC-SWAT/DreamShell
C++
null
404
/* CDC_ECM_Itf_Process Data received over USB OUT endpoint are sent over CDC_ECM interface through this function. */
static int8_t CDC_ECM_Itf_Process(USBD_HandleTypeDef *pdev)
/* CDC_ECM_Itf_Process Data received over USB OUT endpoint are sent over CDC_ECM interface through this function. */ static int8_t CDC_ECM_Itf_Process(USBD_HandleTypeDef *pdev)
{ USBD_CDC_ECM_HandleTypeDef *hcdc_cdc_ecm = (USBD_CDC_ECM_HandleTypeDef *)(pdev->pClassData); if ((hcdc_cdc_ecm != NULL) && (hcdc_cdc_ecm->LinkStatus != 0U)) { } return (0); }
4ms/stm32mp1-baremetal
C++
Other
137
/* Writes a data byte to the shared parameter buffer at the specified index. */
bool SharedParamsWriteByIndex(uint32_t idx, uint8_t value)
/* Writes a data byte to the shared parameter buffer at the specified index. */ bool SharedParamsWriteByIndex(uint32_t idx, uint8_t value)
{ bool result = false; if ( (SharedParamsValidateBuffer()) && (idx < SHARED_PARAMS_CFG_BUFFER_DATA_LEN) ) { sharedParamsBuffer.data[idx] = value; SharedParamsWriteChecksum(); result = true; } return result; }
feaser/openblt
C++
GNU General Public License v3.0
601