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
/* Configure pins as Analog Input Output EVENT_OUT EXTI */
void PMU_Sleep_Tim0(void)
/* Configure pins as Analog Input Output EVENT_OUT EXTI */ void PMU_Sleep_Tim0(void)
{ HAL_PMU_TIMER0_Start(&hpmu, 5); while (1) { HAL_PMU_Enter_Sleep(&hpmu); printf("."); } }
pikasTech/PikaPython
C++
MIT License
1,403
/* This function sets the verification mode flags for the TLS connection. */
VOID EFIAPI CryptoServiceTlsSetVerify(IN VOID *Tls, IN UINT32 VerifyMode)
/* This function sets the verification mode flags for the TLS connection. */ VOID EFIAPI CryptoServiceTlsSetVerify(IN VOID *Tls, IN UINT32 VerifyMode)
{ CALL_VOID_BASECRYPTLIB (TlsSet.Services.Verify, TlsSetVerify, (Tls, VerifyMode)); }
tianocore/edk2
C++
Other
4,240
/* This function actually belongs to the journal, but we keep it here because we want to keep it static. */
static int bud_wbuf_callback(struct ubifs_info *c, int lnum, int free, int pad)
/* This function actually belongs to the journal, but we keep it here because we want to keep it static. */ static int bud_wbuf_callback(struct ubifs_info *c, int lnum, int free, int pad)
{ return ubifs_update_one_lp(c, lnum, free, pad, 0, 0); }
robutest/uclinux
C++
GPL-2.0
60
/* For a description of volatile and non-volatile environment variables, see UEFI Shell 2.0 specification section 3.6.1. */
EFI_STATUS EFIAPI EfiShellSetEnv(IN CONST CHAR16 *Name, IN CONST CHAR16 *Value, IN BOOLEAN Volatile)
/* For a description of volatile and non-volatile environment variables, see UEFI Shell 2.0 specification section 3.6.1. */ EFI_STATUS EFIAPI EfiShellSetEnv(IN CONST CHAR16 *Name, IN CONST CHAR16 *Value, IN BOOLEAN Volatile)
{ if ((Name == NULL) || (*Name == CHAR_NULL)) { return (EFI_INVALID_PARAMETER); } if ((StrCmp (Name, L"cwd") == 0) || (StrCmp (Name, L"lasterror") == 0) || (StrCmp (Name, L"profiles") == 0) || (StrCmp (Name, L"uefishellsupport") == 0) || (StrCmp (Name, L"uefishellversion") == 0) || (StrCmp (Name, L"uefiversion") == 0) || (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoNest && (StrCmp (Name, mNoNestingEnvVarName) == 0)) ) { return (EFI_INVALID_PARAMETER); } return (InternalEfiShellSetEnv (Name, Value, Volatile)); }
tianocore/edk2
C++
Other
4,240
/* Returns 1 if the given PCM format is signed linear, 0 if unsigned linear, and a negative error code for non-linear formats. */
int snd_pcm_format_signed(snd_pcm_format_t format)
/* Returns 1 if the given PCM format is signed linear, 0 if unsigned linear, and a negative error code for non-linear formats. */ int snd_pcm_format_signed(snd_pcm_format_t format)
{ int val; if (format < 0 || format > SNDRV_PCM_FORMAT_LAST) return -EINVAL; if ((val = pcm_formats[format].signd) < 0) return -EINVAL; return val; }
robutest/uclinux
C++
GPL-2.0
60
/* Called from process context only (admin command and after_state_ch). */
static int _drbd_pause_after(struct drbd_conf *mdev)
/* Called from process context only (admin command and after_state_ch). */ static int _drbd_pause_after(struct drbd_conf *mdev)
{ struct drbd_conf *odev; int i, rv = 0; for (i = 0; i < minor_count; i++) { odev = minor_to_mdev(i); if (!odev) continue; if (odev->state.conn == C_STANDALONE && odev->state.disk == D_DISKLESS) continue; if (!_drbd_may_sync_now(odev)) rv |= (__drbd_set_state(_NS(odev, aftr_isp, 1), CS_HARD, NULL) != SS_NOTHING_TO_DO); } return rv; }
robutest/uclinux
C++
GPL-2.0
60
/* Initialize the boards on-board LED (Amber LED "L") The LED is connected to the following pin: */
void led_init(void)
/* Initialize the boards on-board LED (Amber LED "L") The LED is connected to the following pin: */ void led_init(void)
{ LED_PORT->PIO_PER = LED_PIN; LED_PORT->PIO_OER = LED_PIN; LED_PORT->PIO_OWER = LED_PIN; LED_PORT->PIO_PUDR = LED_PIN; LED_PORT->PIO_CODR = LED_PIN; }
labapart/polymcu
C++
null
201
/* Return frequency for pll with 2 dividers and a multiplier. */
static __unused uint32_t get_pll_div_frequency(uint32_t pllsrc_freq, int pllm_div, int plln_mul, int pllout_div)
/* Return frequency for pll with 2 dividers and a multiplier. */ static __unused uint32_t get_pll_div_frequency(uint32_t pllsrc_freq, int pllm_div, int plln_mul, int pllout_div)
{ __ASSERT_NO_MSG(pllm_div && pllout_div); return pllsrc_freq / pllm_div * plln_mul / pllout_div; }
zephyrproject-rtos/zephyr
C++
Apache License 2.0
9,573
/* Configures the PLL clock source and multiplication factor. */
void RCC_PLLConfig(uint32_t RCC_PLLSource, uint32_t RCC_PLLMul)
/* Configures the PLL clock source and multiplication factor. */ void RCC_PLLConfig(uint32_t RCC_PLLSource, uint32_t RCC_PLLMul)
{ assert_param(IS_RCC_PLL_SOURCE(RCC_PLLSource)); assert_param(IS_RCC_PLL_MUL(RCC_PLLMul)); RCC->CFGR &= ~(RCC_CFGR_PLLMUL | RCC_CFGR_PLLSRC); RCC->CFGR |= (uint32_t)(RCC_PLLSource | RCC_PLLMul); }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* The time (1 LSB = 1/ODR) interval that starts after the first click detection where the click-detection procedure is disabled, in cases where the device is configured for double-click detection.. */
int32_t lis2dh12_quiet_dur_set(stmdev_ctx_t *ctx, uint8_t val)
/* The time (1 LSB = 1/ODR) interval that starts after the first click detection where the click-detection procedure is disabled, in cases where the device is configured for double-click detection.. */ int32_t lis2dh12_quiet_dur_set(stmdev_ctx_t *ctx, uint8_t val)
{ lis2dh12_time_latency_t time_latency; int32_t ret; ret = lis2dh12_read_reg(ctx, LIS2DH12_TIME_LATENCY, (uint8_t *)&time_latency, 1); if (ret == 0) { time_latency.tla = val; ret = lis2dh12_write_reg(ctx, LIS2DH12_TIME_LATENCY, (uint8_t *)&time_latency, 1); } return ret; }
prusa3d/Prusa-Firmware-Buddy
C++
Other
1,019
/* Display a string in lcd glass numeric field. This function will write the input string to the numeric field of the lcd glass. */
static void c42364a_slcdc_display_num_string(const uint8_t *data)
/* Display a string in lcd glass numeric field. This function will write the input string to the numeric field of the lcd glass. */ static void c42364a_slcdc_display_num_string(const uint8_t *data)
{ for(uint8_t i=0; i<4; i++){ if(data[i] == ASCII_SP) { c42364a_slcdc_efface_symbol(SLCDC, symbol_d[i], SYMBOL_D_LEN); } else { c42364a_slcdc_display_symbol(SLCDC, symbol_d[i], SYMBOL_D_LEN, plot_number[data[i] - ASCII_0]); } } }
remotemcu/remcu-chip-sdks
C++
null
436
/* Cleanup function for a menu bar. frees all allocated memory. */
VOID MenuBarCleanup(VOID)
/* Cleanup function for a menu bar. frees all allocated memory. */ VOID MenuBarCleanup(VOID)
{ SHELL_FREE_NON_NULL (MenuItems); }
tianocore/edk2
C++
Other
4,240
/* Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: */
static void RunThread(void *args)
/* Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: */ static void RunThread(void *args)
{ SDL_RunThread((SDL_Thread *) args); }
alibaba/AliOS-Things
C++
Apache License 2.0
4,536
/* Delete Load Option that represent a Deleted state in DriverOptionMenu. */
EFI_STATUS Var_DelDriverOption(VOID)
/* Delete Load Option that represent a Deleted state in DriverOptionMenu. */ EFI_STATUS Var_DelDriverOption(VOID)
{ BM_MENU_ENTRY *NewMenuEntry; BM_LOAD_CONTEXT *NewLoadContext; EFI_STATUS Status; UINTN Index; UINTN Index2; Index2 = 0; for (Index = 0; Index < DriverOptionMenu.MenuNumber; Index++) { NewMenuEntry = BOpt_GetMenuEntry (&DriverOptionMenu, (Index - Index2)); if (NULL == NewMenuEntry) { return EFI_NOT_FOUND; } NewLoadContext = (BM_LOAD_CONTEXT *)NewMenuEntry->VariableContext; if (!NewLoadContext->Deleted) { continue; } Status = EfiBootManagerDeleteLoadOptionVariable (NewMenuEntry->OptionNumber, LoadOptionTypeDriver); if (EFI_ERROR (Status)) { return Status; } Index2++; RemoveEntryList (&NewMenuEntry->Link); BOpt_DestroyMenuEntry (NewMenuEntry); NewMenuEntry = NULL; } DriverOptionMenu.MenuNumber -= Index2; return EFI_SUCCESS; }
tianocore/edk2
C++
Other
4,240
/* If user input *File != NULL, function will return the allocate device path info for the choosed file, caller has to free the memory after use it. */
EFI_STATUS EFIAPI ChooseFile(IN EFI_DEVICE_PATH_PROTOCOL *RootDirectory, IN CHAR16 *FileType OPTIONAL, IN CHOOSE_HANDLER ChooseHandler OPTIONAL, OUT EFI_DEVICE_PATH_PROTOCOL **File OPTIONAL)
/* If user input *File != NULL, function will return the allocate device path info for the choosed file, caller has to free the memory after use it. */ EFI_STATUS EFIAPI ChooseFile(IN EFI_DEVICE_PATH_PROTOCOL *RootDirectory, IN CHAR16 *FileType OPTIONAL, IN CHOOSE_HANDLER ChooseHandler OPTIONAL, OUT EFI_DEVICE_PATH_PROTOCOL **File OPTIONAL)
{ return mProtocol->ChooseFile (RootDirectory, FileType, ChooseHandler, File); }
tianocore/edk2
C++
Other
4,240
/* This routine saves the current "Decode As"-entries into the preferences file */
static void decode_show_save_cb(GtkWidget *win _U_, gpointer user_data _U_)
/* This routine saves the current "Decode As"-entries into the preferences file */ static void decode_show_save_cb(GtkWidget *win _U_, gpointer user_data _U_)
{ gchar* err = NULL; if (save_decode_as_entries(&err) < 0) { simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err); g_free(err); } }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* Function returns a system configuration table that is stored in the EFI System Table based on the provided GUID. */
EFI_STATUS GetSystemConfigurationTable(IN EFI_GUID *TableGuid, IN OUT VOID **Table)
/* Function returns a system configuration table that is stored in the EFI System Table based on the provided GUID. */ EFI_STATUS GetSystemConfigurationTable(IN EFI_GUID *TableGuid, IN OUT VOID **Table)
{ UINTN Index; ASSERT (Table != NULL); for (Index = 0; Index < gST->NumberOfTableEntries; Index++) { if (CompareGuid (TableGuid, &(gST->ConfigurationTable[Index].VendorGuid))) { *Table = gST->ConfigurationTable[Index].VendorTable; return EFI_SUCCESS; } } return EFI_NOT_FOUND; }
tianocore/edk2
C++
Other
4,240
/* Return the number of bytes of space available in the circular buffer. */
static unsigned int edge_buf_space_avail(struct edge_buf *eb)
/* Return the number of bytes of space available in the circular buffer. */ static unsigned int edge_buf_space_avail(struct edge_buf *eb)
{ if (eb == NULL) return 0; return ((eb->buf_size + eb->buf_get - eb->buf_put - 1) % eb->buf_size); }
robutest/uclinux
C++
GPL-2.0
60
/* free_mem_extents - free a list of memory extents @list - list of extents to empty */
static void free_mem_extents(struct list_head *list)
/* free_mem_extents - free a list of memory extents @list - list of extents to empty */ static void free_mem_extents(struct list_head *list)
{ struct mem_extent *ext, *aux; list_for_each_entry_safe(ext, aux, list, hook) { list_del(&ext->hook); kfree(ext); } }
EmcraftSystems/linux-emcraft
C++
Other
266
/* fit_calc_size() - Calculate the approximate size of the FIT we will generate */
static int fit_calc_size(struct image_tool_params *params)
/* fit_calc_size() - Calculate the approximate size of the FIT we will generate */ static int fit_calc_size(struct image_tool_params *params)
{ struct content_info *cont; int size, total_size; size = imagetool_get_filesize(params, params->datafile); if (size < 0) return -1; total_size = size; if (params->fit_ramdisk) { size = imagetool_get_filesize(params, params->fit_ramdisk); if (size < 0) return -1; total_size += size; } for (cont = params->content_head; cont; cont = cont->next) { size = imagetool_get_filesize(params, cont->fname); if (size < 0) return -1; total_size += size + 300; } total_size += 4096; return total_size; }
4ms/stm32mp1-baremetal
C++
Other
137
/* Frees all SGE related resources and the sge structure itself */
void t1_sge_destroy(struct sge *sge)
/* Frees all SGE related resources and the sge structure itself */ void t1_sge_destroy(struct sge *sge)
{ int i; for_each_port(sge->adapter, i) free_percpu(sge->port_stats[i]); kfree(sge->tx_sched); free_tx_resources(sge); free_rx_resources(sge); kfree(sge); }
robutest/uclinux
C++
GPL-2.0
60
/* Gets a data element from the SPI interface. */
void SPIDataRead(unsigned long ulBase, void *pulRData, unsigned long ulLen)
/* Gets a data element from the SPI interface. */ void SPIDataRead(unsigned long ulBase, void *pulRData, unsigned long ulLen)
{ unsigned long i; xASSERT((ulBase == SPI3_BASE) || (ulBase == SPI1_BASE)|| (ulBase == SPI2_BASE)); for (i=0; i<ulLen; i++) { if ((xHWREG(ulBase + SPI_CR1) & SPI_CR1_DFF) != SPI_CR1_DFF) { ((unsigned char*)pulRData)[i] = SPISingleDataReadWrite(ulBase, 0xFF); } else { ((unsigned short*)pulRData)[i] = SPISingleDataReadWrite(ulBase, 0xFFFF); } } }
coocox/cox
C++
Berkeley Software Distribution (BSD)
104
/* Reads and returns the current value of TSC. This function is only available on IA-32 and X64. */
UINT64 EFIAPI AsmReadTsc(VOID)
/* Reads and returns the current value of TSC. This function is only available on IA-32 and X64. */ UINT64 EFIAPI AsmReadTsc(VOID)
{ UINT64 Data; __asm__ __volatile__ ( "rdtsc" : "=A" (Data) ); return Data; }
tianocore/edk2
C++
Other
4,240
/* Trim the list of attributes defined to remove all those of type CDATA as they are not special. This call should be done when finishing to parse the DTD and before starting to parse the document root. */
static void xmlCleanSpecialAttr(xmlParserCtxtPtr ctxt)
/* Trim the list of attributes defined to remove all those of type CDATA as they are not special. This call should be done when finishing to parse the DTD and before starting to parse the document root. */ static void xmlCleanSpecialAttr(xmlParserCtxtPtr ctxt)
{ if (ctxt->attsSpecial == NULL) return; xmlHashScanFull(ctxt->attsSpecial, xmlCleanSpecialAttrCallback, ctxt); if (xmlHashSize(ctxt->attsSpecial) == 0) { xmlHashFree(ctxt->attsSpecial, NULL); ctxt->attsSpecial = NULL; } return; }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* Perform deconfigure channel-path command sclp command for specified chpid and wait for completion. On success return 0. Return non-zero otherwise. */
int sclp_chp_deconfigure(struct chp_id chpid)
/* Perform deconfigure channel-path command sclp command for specified chpid and wait for completion. On success return 0. Return non-zero otherwise. */ int sclp_chp_deconfigure(struct chp_id chpid)
{ return do_chp_configure(SCLP_CMDW_DECONFIGURE_CHPATH | chpid.id << 8); }
robutest/uclinux
C++
GPL-2.0
60
/* Event handler for the USB_ControlRequest event. This is used to catch and process control requests sent to the device from the USB host before passing along unhandled control requests to the library for processing internally. */
void EVENT_USB_Device_ControlRequest(void)
/* Event handler for the USB_ControlRequest event. This is used to catch and process control requests sent to the device from the USB host before passing along unhandled control requests to the library for processing internally. */ void EVENT_USB_Device_ControlRequest(void)
{ switch (USB_ControlRequest.bRequest) { case HID_REQ_GetReport: if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE)) { uint8_t GenericData[GENERIC_REPORT_SIZE]; CreateGenericHIDReport(GenericData); Endpoint_ClearSETUP(); Endpoint_Write_Control_Stream_LE(&GenericData, sizeof(GenericData)); Endpoint_ClearOUT(); } break; case HID_REQ_SetReport: if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) { uint8_t GenericData[GENERIC_REPORT_SIZE]; Endpoint_ClearSETUP(); Endpoint_Read_Control_Stream_LE(&GenericData, sizeof(GenericData)); Endpoint_ClearIN(); ProcessGenericHIDReport(GenericData); } break; } }
prusa3d/Prusa-Firmware-Buddy
C++
Other
1,019
/* Set minimum number of taps needed for an interrupt. */
int dmp_set_tap_count(unsigned char min_taps)
/* Set minimum number of taps needed for an interrupt. */ int dmp_set_tap_count(unsigned char min_taps)
{ unsigned char tmp; if (min_taps < 1) min_taps = 1; else if (min_taps > 4) min_taps = 4; tmp = min_taps - 1; return mpu_write_mem(D_1_79, 1, &tmp); }
Luos-io/luos_engine
C++
MIT License
496
/* STP timing alert. There are three causes: 1) timing status change 2) link availability change 3) time control parameter change In all three cases we are only interested in the clock source state. If a STP clock source is now available use it. */
static void stp_timing_alert(struct stp_irq_parm *)
/* STP timing alert. There are three causes: 1) timing status change 2) link availability change 3) time control parameter change In all three cases we are only interested in the clock source state. If a STP clock source is now available use it. */ static void stp_timing_alert(struct stp_irq_parm *)
{ if (intparm->tsc || intparm->lac || intparm->tcpc) queue_work(time_sync_wq, &stp_work); }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Unsets a mask set by g_file_info_set_attribute_mask(), if one is set. */
void g_file_info_unset_attribute_mask(GFileInfo *info)
/* Unsets a mask set by g_file_info_set_attribute_mask(), if one is set. */ void g_file_info_unset_attribute_mask(GFileInfo *info)
{ g_return_if_fail (G_IS_FILE_INFO (info)); if (info->mask != NO_ATTRIBUTE_MASK) g_file_attribute_matcher_unref (info->mask); info->mask = NO_ATTRIBUTE_MASK; }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* Search connection list of the SAP and finds connection listening on local mac, and local sap. Returns pointer for parent socket found, NULL otherwise. Caller has to make sure local_bh is disabled. */
static struct sock* llc_lookup_listener(struct llc_sap *sap, struct llc_addr *laddr)
/* Search connection list of the SAP and finds connection listening on local mac, and local sap. Returns pointer for parent socket found, NULL otherwise. Caller has to make sure local_bh is disabled. */ static struct sock* llc_lookup_listener(struct llc_sap *sap, struct llc_addr *laddr)
{ struct sock *rc; struct hlist_node *node; read_lock(&sap->sk_list.lock); sk_for_each(rc, node, &sap->sk_list.list) { struct llc_sock *llc = llc_sk(rc); if (rc->sk_type == SOCK_STREAM && rc->sk_state == TCP_LISTEN && llc->laddr.lsap == laddr->lsap && (llc_mac_match(llc->laddr.mac, laddr->mac) || llc_mac_null(llc->laddr.mac))) { sock_hold(rc); goto found; } } rc = NULL; found: read_unlock(&sap->sk_list.lock); return rc; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* If Cert is NULL, then return FALSE. If CertSize is 0, then return FALSE. If this interface is not supported, then return FALSE. */
BOOLEAN EFIAPI CryptoServiceX509GetVersion(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINTN *Version)
/* If Cert is NULL, then return FALSE. If CertSize is 0, then return FALSE. If this interface is not supported, then return FALSE. */ BOOLEAN EFIAPI CryptoServiceX509GetVersion(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINTN *Version)
{ return CALL_BASECRYPTLIB (X509.Services.GetVersion, X509GetVersion, (Cert, CertSize, Version), FALSE); }
tianocore/edk2
C++
Other
4,240
/* Enters a critical section. The functions UtilCriticalSectionEnter and UtilCriticalSectionExit should always be used in a pair. */
void UtilCriticalSectionEnter(void)
/* Enters a critical section. The functions UtilCriticalSectionEnter and UtilCriticalSectionExit should always be used in a pair. */ void UtilCriticalSectionEnter(void)
{ assert(criticalSectionInitialized); if (criticalSectionInitialized) { EnterCriticalSection((CRITICAL_SECTION *)&criticalSection); } }
feaser/openblt
C++
GNU General Public License v3.0
601
/* This function replaces the original CANGetBitTiming() API and performs the same actions. A macro is provided in */
void CANBitTimingGet(unsigned long ulBase, tCANBitClkParms *pClkParms)
/* This function replaces the original CANGetBitTiming() API and performs the same actions. A macro is provided in */ void CANBitTimingGet(unsigned long ulBase, tCANBitClkParms *pClkParms)
{ unsigned int uBitReg; ASSERT(CANBaseValid(ulBase)); ASSERT(pClkParms != 0); uBitReg = CANRegRead(ulBase + CAN_O_BIT); pClkParms->uPhase2Seg = ((uBitReg & CAN_BIT_TSEG2_M) >> 12) + 1; pClkParms->uSyncPropPhase1Seg = ((uBitReg & CAN_BIT_TSEG1_M) >> 8) + 1; pClkParms->uSJW = ((uBitReg & CAN_BIT_SJW_M) >> 6) + 1; pClkParms->uQuantumPrescaler = ((uBitReg & CAN_BIT_BRP_M) | ((CANRegRead(ulBase + CAN_O_BRPE) & CAN_BRPE_BRPE_M) << 6)) + 1; }
watterott/WebRadio
C++
null
71
/* Enable the SPI interrupt of the specified SPI port. */
void xSPIIntEnable(unsigned long ulBase, unsigned long ulIntFlags)
/* Enable the SPI interrupt of the specified SPI port. */ void xSPIIntEnable(unsigned long ulBase, unsigned long ulIntFlags)
{ xASSERT((ulBase == SPI0_BASE) || (ulBase == SPI1_BASE)|| (ulBase == SPI2_BASE) || (ulBase == SPI3_BASE)); if(ulIntFlags == SPI_INT_EOT){ xHWREG(ulBase + SPI_CNTRL) |= SPI_CNTRL_IE; } else if(ulIntFlags == SPI_INT_3WIRE){ xHWREG(ulBase + SPI_CNTRL2) |= SPI_CNTRL2_SSTA_INTEN; } else { xHWREG(ulBase + SPI_FIFOCTL) |= ulIntFlags; } }
coocox/cox
C++
Berkeley Software Distribution (BSD)
104
/* This is the entry point for the bootloader application and is called by the reset interrupt vector after the C-startup routines executed. */
int main(void)
/* This is the entry point for the bootloader application and is called by the reset interrupt vector after the C-startup routines executed. */ int main(void)
{ Init(); BootInit(); while (1) { BootTask(); } return 0; }
feaser/openblt
C++
GNU General Public License v3.0
601
/* Returns: (type GObject.Object) (transfer full): object content of @value, should be unreferenced when no longer needed. */
gpointer g_value_dup_object(const GValue *value)
/* Returns: (type GObject.Object) (transfer full): object content of @value, should be unreferenced when no longer needed. */ gpointer g_value_dup_object(const GValue *value)
{ g_return_val_if_fail (G_VALUE_HOLDS_OBJECT (value), NULL); return value->data[0].v_pointer ? g_object_ref (value->data[0].v_pointer) : NULL; }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* Returns TRUE if the instance of #CRNum is a fixed length number, FALSE otherwise. */
gboolean cr_num_is_fixed_length(CRNum *a_this)
/* Returns TRUE if the instance of #CRNum is a fixed length number, FALSE otherwise. */ gboolean cr_num_is_fixed_length(CRNum *a_this)
{ gboolean result = FALSE; g_return_val_if_fail (a_this, FALSE); if (a_this->type >= NUM_LENGTH_EM && a_this->type <= NUM_LENGTH_PC) { result = TRUE ; } return result ; }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* Initializes the communication session module for the specified protocol. */
void SessionInit(tSessionProtocol const *protocol, void const *protocolSettings)
/* Initializes the communication session module for the specified protocol. */ void SessionInit(tSessionProtocol const *protocol, void const *protocolSettings)
{ assert(protocol != NULL); protocolPtr = protocol; if (protocolPtr != NULL) { protocolPtr->Init(protocolSettings); } }
feaser/openblt
C++
GNU General Public License v3.0
601
/* Note: The SxCCR.DC and SxCCR.PM bits are only used if the SSI is the clock master. */
static int fsl_ssi_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *hw_params, struct snd_soc_dai *cpu_dai)
/* Note: The SxCCR.DC and SxCCR.PM bits are only used if the SSI is the clock master. */ static int fsl_ssi_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *hw_params, struct snd_soc_dai *cpu_dai)
{ struct fsl_ssi_private *ssi_private = cpu_dai->private_data; if (substream == ssi_private->first_stream) { struct ccsr_ssi __iomem *ssi = ssi_private->ssi; unsigned int sample_size = snd_pcm_format_width(params_format(hw_params)); u32 wl = CCSR_SSI_SxCCR_WL(sample_size); if ((substream->stream == SNDRV_PCM_STREAM_PLAYBACK) || !ssi_private->asynchronous) clrsetbits_be32(&ssi->stccr, CCSR_SSI_SxCCR_WL_MASK, wl); else clrsetbits_be32(&ssi->srccr, CCSR_SSI_SxCCR_WL_MASK, wl); } return 0; }
robutest/uclinux
C++
GPL-2.0
60
/* The length of the hash result is dependent on the algorithm that is in use. The following table shows the correct array size for each algorithm: */
void SHAMD5DataProcess(uint32_t ui32Base, uint32_t *pui32DataSrc, uint32_t ui32DataLength, uint32_t *pui32HashResult)
/* The length of the hash result is dependent on the algorithm that is in use. The following table shows the correct array size for each algorithm: */ void SHAMD5DataProcess(uint32_t ui32Base, uint32_t *pui32DataSrc, uint32_t ui32DataLength, uint32_t *pui32HashResult)
{ ASSERT(ui32Base == SHAMD5_BASE); ASSERT((ui32DataLength % 64) == 0); while ((HWREG(ui32Base + SHAMD5_O_IRQSTATUS) & SHAMD5_INT_CONTEXT_READY) == 0) { } SHAMD5HashLengthSet(ui32Base, ui32DataLength); _SHAMD5DataWriteMultiple(ui32Base, pui32DataSrc, ui32DataLength); while ((HWREG(ui32Base + SHAMD5_O_IRQSTATUS) & SHAMD5_INT_OUTPUT_READY) == 0) { } SHAMD5ResultRead(ui32Base, pui32HashResult); }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* On exiting boot services we must make sure the Watchdog Timer is stopped. */
STATIC VOID EFIAPI WatchdogExitBootServicesEvent(IN EFI_EVENT Event, IN VOID *Context)
/* On exiting boot services we must make sure the Watchdog Timer is stopped. */ STATIC VOID EFIAPI WatchdogExitBootServicesEvent(IN EFI_EVENT Event, IN VOID *Context)
{ WatchdogDisable (); mTimerPeriod = 0; mExitedBootServices = TRUE; }
tianocore/edk2
C++
Other
4,240
/* The set will be rejected if the last BD of the set does not mark the end of a packet (see XEmacPs_BdSetLast()). */
LONG XEmacPs_BdRingToHw(XEmacPs_BdRing *RingPtr, u32 NumBd, XEmacPs_Bd *BdSetPtr)
/* The set will be rejected if the last BD of the set does not mark the end of a packet (see XEmacPs_BdSetLast()). */ LONG XEmacPs_BdRingToHw(XEmacPs_BdRing *RingPtr, u32 NumBd, XEmacPs_Bd *BdSetPtr)
{ XEmacPs_Bd *CurBdPtr; u32 i; LONG Status; if (0U == NumBd){ Status = (LONG)(XST_SUCCESS); } else { if ((RingPtr->PreCnt < NumBd) || (RingPtr->PreHead != BdSetPtr)) { Status = (LONG)(XST_DMA_SG_LIST_ERROR); } else { CurBdPtr = BdSetPtr; for (i = 0U; i < NumBd; i++) { CurBdPtr = (XEmacPs_Bd *)((void *)XEmacPs_BdRingNext(RingPtr, CurBdPtr)); } XEMACPS_RING_SEEKAHEAD(RingPtr, RingPtr->PreHead, NumBd); RingPtr->PreCnt -= NumBd; RingPtr->HwTail = CurBdPtr; RingPtr->HwCnt += NumBd; Status = (LONG)(XST_SUCCESS); } } return Status; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Compare two strings 'ls' x 'rs', returning an integer less-equal- -greater than zero if 'ls' is less-equal-greater than 'rs'. The code is a little tricky because it allows '\0' in the strings and it uses 'strcoll' (to respect locales) for each segments of the strings. */
static int l_strcmp(const TString *ls, const TString *rs)
/* Compare two strings 'ls' x 'rs', returning an integer less-equal- -greater than zero if 'ls' is less-equal-greater than 'rs'. The code is a little tricky because it allows '\0' in the strings and it uses 'strcoll' (to respect locales) for each segments of the strings. */ static int l_strcmp(const TString *ls, const TString *rs)
{ int temp = strcoll(l, r); if (temp != 0) return temp; else { size_t len = strlen(l); if (len == lr) return (len == ll) ? 0 : 1; else if (len == ll) return -1; len++; l += len; ll -= len; r += len; lr -= len; } } }
Nicholas3388/LuaNode
C++
Other
1,055
/* Interrupt status bit for FSM long counter timeout interrupt event.. */
int32_t lsm6dso_long_cnt_flag_data_ready_get(stmdev_ctx_t *ctx, uint8_t *val)
/* Interrupt status bit for FSM long counter timeout interrupt event.. */ int32_t lsm6dso_long_cnt_flag_data_ready_get(stmdev_ctx_t *ctx, uint8_t *val)
{ lsm6dso_emb_func_status_t reg; int32_t ret; ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_EMBEDDED_FUNC_BANK); if (ret == 0) { ret = lsm6dso_read_reg(ctx, LSM6DSO_EMB_FUNC_STATUS, (uint8_t *)&reg, 1); } if (ret == 0) { *val = reg.is_fsm_lc; ret = lsm6dso_mem_bank_set(ctx, LSM6DSO_USER_BANK); } return ret; }
eclipse-threadx/getting-started
C++
Other
310
/* param base ENET peripheral base address. param srcClock_Hz This is the ENET module clock frequency. Normally it's the system clock. See clock distribution. param isPreambleDisabled The preamble disable flag. */
void ENET_SetSMI(ENET_Type *base, uint32_t srcClock_Hz, bool isPreambleDisabled)
/* param base ENET peripheral base address. param srcClock_Hz This is the ENET module clock frequency. Normally it's the system clock. See clock distribution. param isPreambleDisabled The preamble disable flag. */ void ENET_SetSMI(ENET_Type *base, uint32_t srcClock_Hz, bool isPreambleDisabled)
{ assert(srcClock_Hz); uint32_t clkCycle = 0; uint32_t speed = 0; uint32_t mscr = 0; speed = srcClock_Hz / (2 * ENET_MDC_FREQUENCY); clkCycle = (10 + ENET_NANOSECOND_ONE_SECOND / srcClock_Hz - 1) / (ENET_NANOSECOND_ONE_SECOND / srcClock_Hz) - 1; mscr = ENET_MSCR_MII_SPEED(speed) | ENET_MSCR_HOLDTIME(clkCycle) | (isPreambleDisabled ? ENET_MSCR_DIS_PRE_MASK : 0); base->MSCR = mscr; }
nanoframework/nf-interpreter
C++
MIT License
293
/* Initialize sercom i2c module to use in async mode. */
int32_t _i2c_m_async_init(struct _i2c_m_async_device *const i2c_dev, void *const hw)
/* Initialize sercom i2c module to use in async mode. */ int32_t _i2c_m_async_init(struct _i2c_m_async_device *const i2c_dev, void *const hw)
{ int32_t init_status; ASSERT(i2c_dev); i2c_dev->hw = hw; init_status = _i2c_m_sync_init_impl(&i2c_dev->service, hw); if (init_status) { return init_status; } _sercom_init_irq_param(hw, (void *)i2c_dev); uint8_t irq = _sercom_get_irq_num(hw); for (uint32_t i = 0; i < 4; i++) { NVIC_DisableIRQ((IRQn_Type)irq); NVIC_ClearPendingIRQ((IRQn_Type)irq); NVIC_EnableIRQ((IRQn_Type)irq); irq++; } return ERR_NONE; }
eclipse-threadx/getting-started
C++
Other
310
/* On 34xx we can get occasional spurious interrupts if the ack from an interrupt handler does not get posted before we unmask. Warn about the interrupt handlers that need to flush posted writes. */
static int omap_check_spurious(unsigned int irq)
/* On 34xx we can get occasional spurious interrupts if the ack from an interrupt handler does not get posted before we unmask. Warn about the interrupt handlers that need to flush posted writes. */ static int omap_check_spurious(unsigned int irq)
{ u32 sir, spurious; sir = intc_bank_read_reg(&irq_banks[0], INTC_SIR); spurious = sir >> 7; if (spurious) { printk(KERN_WARNING "Spurious irq %i: 0x%08x, please flush " "posted write for irq %i\n", irq, sir, previous_irq); return spurious; } return 0; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* RETURNS: Matching xfer_mode, 0xff if no match found. */
u8 ata_timing_cycle2mode(unsigned int xfer_shift, int cycle)
/* RETURNS: Matching xfer_mode, 0xff if no match found. */ u8 ata_timing_cycle2mode(unsigned int xfer_shift, int cycle)
{ u8 base_mode = 0xff, last_mode = 0xff; const struct ata_xfer_ent *ent; const struct ata_timing *t; for (ent = ata_xfer_tbl; ent->shift >= 0; ent++) if (ent->shift == xfer_shift) base_mode = ent->base; for (t = ata_timing_find_mode(base_mode); t && ata_xfer_mode2shift(t->mode) == xfer_shift; t++) { unsigned short this_cycle; switch (xfer_shift) { case ATA_SHIFT_PIO: case ATA_SHIFT_MWDMA: this_cycle = t->cycle; break; case ATA_SHIFT_UDMA: this_cycle = t->udma; break; default: return 0xff; } if (cycle > this_cycle) break; last_mode = t->mode; } return last_mode; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Check validity of input arguments. This function checks the validity of input arguments. */
static status_t hashcrypt_sha_check_input_args(HASHCRYPT_Type *base, hashcrypt_hash_ctx_t *ctx, hashcrypt_algo_t algo)
/* Check validity of input arguments. This function checks the validity of input arguments. */ static status_t hashcrypt_sha_check_input_args(HASHCRYPT_Type *base, hashcrypt_hash_ctx_t *ctx, hashcrypt_algo_t algo)
{ if (kStatus_Success != hashcrypt_sha_check_input_alg(base, algo)) { return kStatus_InvalidArgument; } if ((NULL == ctx) || (NULL == base)) { return kStatus_InvalidArgument; } return kStatus_Success; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Calculate the link pointer DMA value for the first Skeleton QH in a frame. */
static __le32 uhci_frame_skel_link(struct uhci_hcd *uhci, int frame)
/* Calculate the link pointer DMA value for the first Skeleton QH in a frame. */ static __le32 uhci_frame_skel_link(struct uhci_hcd *uhci, int frame)
{ int skelnum; skelnum = 8 - (int) __ffs(frame | UHCI_NUMFRAMES); if (skelnum <= 1) skelnum = 9; return LINK_TO_QH(uhci->skelqh[skelnum]); }
robutest/uclinux
C++
GPL-2.0
60
/* USART Set Stop Bit(s). The stop bits are specified as 0.5, 1, 1.5 or 2. */
void usart_set_stopbits(uint32_t usart, uint32_t stopbits)
/* USART Set Stop Bit(s). The stop bits are specified as 0.5, 1, 1.5 or 2. */ void usart_set_stopbits(uint32_t usart, uint32_t stopbits)
{ USART_CR2(usart) = (USART_CR2(usart) & ~USART_CR2_STOP) | stopbits; }
insane-adding-machines/unicore-mx
C++
GNU General Public License v3.0
50
/* Locking: Takes tty_mutex() to protect tty instance Takes tasklist_lock internally to walk sessions Takes ->siglock() when updating signal->tty */
static int tiocsctty(struct tty_struct *tty, int arg)
/* Locking: Takes tty_mutex() to protect tty instance Takes tasklist_lock internally to walk sessions Takes ->siglock() when updating signal->tty */ static int tiocsctty(struct tty_struct *tty, int arg)
{ int ret = 0; if (current->signal->leader && (task_session(current) == tty->session)) return ret; mutex_lock(&tty_mutex); if (!current->signal->leader || current->signal->tty) { ret = -EPERM; goto unlock; } if (tty->session) { if (arg == 1 && capable(CAP_SYS_ADMIN)) { read_lock(&tasklist_lock); session_clear_tty(tty->session); read_unlock(&tasklist_lock); } else { ret = -EPERM; goto unlock; } } proc_set_tty(current, tty); unlock: mutex_unlock(&tty_mutex); return ret; }
robutest/uclinux
C++
GPL-2.0
60
/* USB Device Set Address Function Parameters: adr: USB Device Address Return Value: None */
void USBD_SetAddress(uint32_t adr, uint32_t setup)
/* USB Device Set Address Function Parameters: adr: USB Device Address Return Value: None */ void USBD_SetAddress(uint32_t adr, uint32_t setup)
{ if (setup == 0) { USBHS->DEVICEADDR = (adr << 25); USBHS->DEVICEADDR |= (1UL << 24); } }
ARMmbed/DAPLink
C++
Apache License 2.0
2,140
/* Sets a Stall condition on an endpoint of the Low Level Driver. */
USBD_StatusTypeDef USBD_LL_StallEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr)
/* Sets a Stall condition on an endpoint of the Low Level Driver. */ USBD_StatusTypeDef USBD_LL_StallEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr)
{ HAL_StatusTypeDef hal_status = HAL_OK; USBD_StatusTypeDef usb_status = USBD_OK; hal_status = HAL_PCD_EP_SetStall(pdev->pData, ep_addr); switch (hal_status) { case HAL_OK : usb_status = USBD_OK; break; case HAL_ERROR : usb_status = USBD_FAIL; break; case HAL_BUSY : usb_status = USBD_BUSY; break; case HAL_TIMEOUT : usb_status = USBD_FAIL; break; default : usb_status = USBD_FAIL; break; } return usb_status; }
feaser/openblt
C++
GNU General Public License v3.0
601
/* Configures the SysTick to generate an interrupt each 1 millisecond. */
void SysTick_Configuration(void)
/* Configures the SysTick to generate an interrupt each 1 millisecond. */ void SysTick_Configuration(void)
{ if (SysTick_Config(SystemCoreClock / 1000)) { while (1); } NVIC_SetPriority(SysTick_IRQn, 0x0C); }
remotemcu/remcu-chip-sdks
C++
null
436
/* Reads the raw accelerometer values if you want to skip the sensor system abstraction layer and the float overhead. */
err_t lsm303accelReadRaw(int16_t *x, int16_t *y, int16_t *z)
/* Reads the raw accelerometer values if you want to skip the sensor system abstraction layer and the float overhead. */ err_t lsm303accelReadRaw(int16_t *x, int16_t *y, int16_t *z)
{ uint8_t buffer[6] = { 0, 0, 0, 0, 0, 0 }; if (!_lsm303accelInitialised) { ASSERT_STATUS(lsm303accelInit()); } ASSERT_STATUS(lsm303accelRead48(LSM303_ADDRESS_ACCEL, LSM303_REGISTER_ACCEL_OUT_X_L_A, buffer)); *x = ((int16_t)(buffer[0] | (buffer[1] << 8))) >> 4; *y = ((int16_t)(buffer[2] | (buffer[3] << 8))) >> 4; *z = ((int16_t)(buffer[4] | (buffer[5] << 8))) >> 4; return ERROR_NONE; }
microbuilder/LPC11U_LPC13U_CodeBase
C++
Other
54
/* This is the entry point for the bootloader application and is called by the reset interrupt vector after the C-startup routines executed. */
int main(void)
/* This is the entry point for the bootloader application and is called by the reset interrupt vector after the C-startup routines executed. */ int main(void)
{ Init(); BootComInit(); while (1) { LedToggle(); BootComCheckActivationRequest(); } }
feaser/openblt
C++
GNU General Public License v3.0
601
/* Returns the events that can cause an ADC trigger event. */
uint32_t TimerADCEventGet(uint32_t ui32Base)
/* Returns the events that can cause an ADC trigger event. */ uint32_t TimerADCEventGet(uint32_t ui32Base)
{ ASSERT(_TimerBaseValid(ui32Base)); return (HWREG(ui32Base + TIMER_O_ADCEV)); }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* DAC Channel Trigger Disable. Disable a digital to analog converter channel external trigger. */
void dac_trigger_disable(uint32_t dac, int channel)
/* DAC Channel Trigger Disable. Disable a digital to analog converter channel external trigger. */ void dac_trigger_disable(uint32_t dac, int channel)
{ switch (channel) { case DAC_CHANNEL1: DAC_CR(dac) &= ~DAC_CR_TEN1; break; case DAC_CHANNEL2: DAC_CR(dac) &= ~DAC_CR_TEN2; break; case DAC_CHANNEL_BOTH: DAC_CR(dac) &= ~(DAC_CR_TEN1 | DAC_CR_TEN2); break; default: break; } }
libopencm3/libopencm3
C++
GNU General Public License v3.0
2,931
/* Check that the device given is a valid AX.25 interface that is "up". Or a valid ethernet interface with an AX.25 callsign binding. */
static struct net_device* nr_ax25_dev_get(char *devname)
/* Check that the device given is a valid AX.25 interface that is "up". Or a valid ethernet interface with an AX.25 callsign binding. */ static struct net_device* nr_ax25_dev_get(char *devname)
{ struct net_device *dev; if ((dev = dev_get_by_name(&init_net, devname)) == NULL) return NULL; if ((dev->flags & IFF_UP) && dev->type == ARPHRD_AX25) return dev; dev_put(dev); return NULL; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Remove the RX callback function. This function is usually invoked from the RX callback itself. Once the callback has resumed the application task, there is no need to invoke the callback again. */
void EMAC_Clear_RxCb(void)
/* Remove the RX callback function. This function is usually invoked from the RX callback itself. Once the callback has resumed the application task, there is no need to invoke the callback again. */ void EMAC_Clear_RxCb(void)
{ AT91C_BASE_EMAC->EMAC_IDR = AT91C_EMAC_RCOMP; rxTd.rxCb = (EMAC_RxCallback) 0; }
apopple/Pandaboard-FreeRTOS
C++
null
25
/* igb_watchdog - Timer Call-back @data: pointer to adapter cast into an unsigned long */
static void igb_watchdog(unsigned long)
/* igb_watchdog - Timer Call-back @data: pointer to adapter cast into an unsigned long */ static void igb_watchdog(unsigned long)
{ struct igb_adapter *adapter = (struct igb_adapter *)data; schedule_work(&adapter->watchdog_task); }
robutest/uclinux
C++
GPL-2.0
60
/* Get contents of register REGNO in task TASK. */
unsigned long ptrace_get_reg(struct task_struct *task, int regno)
/* Get contents of register REGNO in task TASK. */ unsigned long ptrace_get_reg(struct task_struct *task, int regno)
{ if (task->thread.regs == NULL) return -EIO; if (regno == PT_MSR) return get_user_msr(task); if (regno < (sizeof(struct pt_regs) / sizeof(unsigned long))) return ((unsigned long *)task->thread.regs)[regno]; return -EIO; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Set the specified data holding register value for DAC channel2. */
void DAC_SetCh2Data(uint32_t DAC_Align, uint16_t Data)
/* Set the specified data holding register value for DAC channel2. */ void DAC_SetCh2Data(uint32_t DAC_Align, uint16_t Data)
{ __IO uint32_t tmp = 0; assert_param(IS_DAC_ALIGN(DAC_Align)); assert_param(IS_DAC_DATA(Data)); tmp = (uint32_t)DAC_BASE; tmp += DR12CH2_OFFSET + DAC_Align; *(__IO uint32_t*)tmp = Data; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Config the ADC peripheral according to the specified parameters in the adcConfig. */
void TSC_Config(TSC_Config_T *tscConfig)
/* Config the ADC peripheral according to the specified parameters in the adcConfig. */ void TSC_Config(TSC_Config_T *tscConfig)
{ TSC->CTRL_B.CTPHSEL = tscConfig->CTPHSEL; TSC->CTRL_B.CTPLSEL = tscConfig->CTPLSEL; TSC->CTRL_B.SSERRVSEL = tscConfig->SpreadSpectrumDev; TSC->CTRL_B.SSEN = tscConfig->SpreadSpectrum; TSC->CTRL_B.SSCDFSEL = tscConfig->SpreadSpectrumPre; TSC->CTRL_B.PGCDFSEL = tscConfig->PulseGeneratorPre; TSC->CTRL_B.MCNTVSEL = tscConfig->MCountValue; TSC->CTRL_B.IODEFCFG = tscConfig->IOMode; TSC->CTRL_B.SYNPPOL = tscConfig->SynchroPinPolarity; TSC->CTRL_B.AMCFG = tscConfig->AcqMode; TSC->INTFCLR = 0x00000003; TSC->INTEN = tscConfig->Interrupts; }
pikasTech/PikaPython
C++
MIT License
1,403
/* This internal function does not flush PCI writes to the device. All users must ensure that they read from the device before either assuming that the device state is up to date, or returning out of this file. This saves a few milliseconds when initialising devices with lots of MSI-X interrupts. */
static u32 __msix_mask_irq(struct msi_desc *desc, u32 flag)
/* This internal function does not flush PCI writes to the device. All users must ensure that they read from the device before either assuming that the device state is up to date, or returning out of this file. This saves a few milliseconds when initialising devices with lots of MSI-X interrupts. */ static u32 __msix_mask_irq(struct msi_desc *desc, u32 flag)
{ u32 mask_bits = desc->masked; unsigned offset = desc->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE + PCI_MSIX_ENTRY_VECTOR_CTRL; mask_bits &= ~1; mask_bits |= flag; writel(mask_bits, desc->mask_base + offset); return mask_bits; }
robutest/uclinux
C++
GPL-2.0
60
/* If HmacSha384Context is NULL, then return FALSE. If NewHmacSha384Context is NULL, then return FALSE. If this interface is not supported, then return FALSE. */
BOOLEAN EFIAPI HmacSha384Duplicate(IN CONST VOID *HmacSha384Context, OUT VOID *NewHmacSha384Context)
/* If HmacSha384Context is NULL, then return FALSE. If NewHmacSha384Context is NULL, then return FALSE. If this interface is not supported, then return FALSE. */ BOOLEAN EFIAPI HmacSha384Duplicate(IN CONST VOID *HmacSha384Context, OUT VOID *NewHmacSha384Context)
{ return HmacMdDuplicate (MBEDTLS_MD_SHA384, HmacSha384Context, NewHmacSha384Context); }
tianocore/edk2
C++
Other
4,240
/* Get number of queued messages in a Message Queue. */
static uint32_t svcRtxMessageQueueGetCount(osMessageQueueId_t mq_id)
/* Get number of queued messages in a Message Queue. */ static uint32_t svcRtxMessageQueueGetCount(osMessageQueueId_t mq_id)
{ EvrRtxMessageQueueGetCount(mq, 0U); return 0U; } EvrRtxMessageQueueGetCount(mq, mq->msg_count); return mq->msg_count; }
ARMmbed/DAPLink
C++
Apache License 2.0
2,140
/* Selects the condition for the system to enter low power mode. */
void NVIC_SystemLPConfig(uint8_t LowPowerMode, FunctionalState NewState)
/* Selects the condition for the system to enter low power mode. */ void NVIC_SystemLPConfig(uint8_t LowPowerMode, FunctionalState NewState)
{ assert_param(IS_NVIC_LP(LowPowerMode)); assert_param(IS_FUNCTIONAL_STATE(NewState)); if (NewState != DISABLE) { SCB->SCR |= LowPowerMode; } else { SCB->SCR &= (uint32_t)(~(uint32_t)LowPowerMode); } }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on. */
void GPIOPinTypeI2S(unsigned long ulPort, unsigned char ucPins)
/* The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on. */ void GPIOPinTypeI2S(unsigned long ulPort, unsigned char ucPins)
{ ASSERT(GPIOBaseValid(ulPort)); GPIODirModeSet(ulPort, ucPins, GPIO_DIR_MODE_HW); GPIOPadConfigSet(ulPort, ucPins, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD); }
watterott/WebRadio
C++
null
71
/* Must be called from within some kind of spinlock/non-preempt region... */
void __flush_tlb_pending(struct ppc64_tlb_batch *batch)
/* Must be called from within some kind of spinlock/non-preempt region... */ void __flush_tlb_pending(struct ppc64_tlb_batch *batch)
{ const struct cpumask *tmp; int i, local = 0; i = batch->index; tmp = cpumask_of(smp_processor_id()); if (cpumask_equal(mm_cpumask(batch->mm), tmp)) local = 1; if (i == 1) flush_hash_page(batch->vaddr[0], batch->pte[0], batch->psize, batch->ssize, local); else flush_hash_range(i, local); batch->index = 0; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Returns an appropriate Linux error code for @response. */
int chsc_error_from_response(int response)
/* Returns an appropriate Linux error code for @response. */ int chsc_error_from_response(int response)
{ switch (response) { case 0x0001: return 0; case 0x0002: case 0x0003: case 0x0006: case 0x0007: case 0x0008: case 0x000a: return -EINVAL; case 0x0004: return -EOPNOTSUPP; default: return -EIO; } }
robutest/uclinux
C++
GPL-2.0
60
/* Here the Song Position Pointer command is decoded. */
static int decode_song_position_pointer(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int cmd_count, unsigned int offset)
/* Here the Song Position Pointer command is decoded. */ static int decode_song_position_pointer(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int cmd_count, unsigned int offset)
{ col_append_fstr(pinfo->cinfo, COL_INFO,", %s (p=%d)", status_str, position ); } else { col_append_fstr(pinfo->cinfo, COL_INFO, "%s (p=%d)", status_str, position ); } return 2; }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* The caller is expected to perform the necessary locking. */
int ssp_flush(struct ssp_dev *dev)
/* The caller is expected to perform the necessary locking. */ int ssp_flush(struct ssp_dev *dev)
{ struct ssp_device *ssp = dev->ssp; int timeout = TIMEOUT * 2; if (cpu_is_pxa3xx()) { while (__raw_readl(ssp->mmio_base + SSSR) & 0xf00) { if (!--timeout) return -ETIMEDOUT; cpu_relax(); } timeout = TIMEOUT * 2; } do { while (__raw_readl(ssp->mmio_base + SSSR) & SSSR_RNE) { if (!--timeout) return -ETIMEDOUT; (void)__raw_readl(ssp->mmio_base + SSDR); } if (!--timeout) return -ETIMEDOUT; } while (__raw_readl(ssp->mmio_base + SSSR) & SSSR_BSY); return 0; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* This function validates and applies a proposed mass change to the current process's capability sets. The changes are made to the proposed new credentials, and assuming no error, will be committed by the caller of LSM. */
int cap_capset(struct cred *new, const struct cred *old, const kernel_cap_t *effective, const kernel_cap_t *inheritable, const kernel_cap_t *permitted)
/* This function validates and applies a proposed mass change to the current process's capability sets. The changes are made to the proposed new credentials, and assuming no error, will be committed by the caller of LSM. */ int cap_capset(struct cred *new, const struct cred *old, const kernel_cap_t *effective, const kernel_cap_t *inheritable, const kernel_cap_t *permitted)
{ if (cap_inh_is_capped() && !cap_issubset(*inheritable, cap_combine(old->cap_inheritable, old->cap_permitted))) return -EPERM; if (!cap_issubset(*inheritable, cap_combine(old->cap_inheritable, old->cap_bset))) return -EPERM; if (!cap_issubset(*permitted, old->cap_permitted)) return -EPERM; if (!cap_issubset(*effective, *permitted)) return -EPERM; new->cap_effective = *effective; new->cap_inheritable = *inheritable; new->cap_permitted = *permitted; return 0; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* prevent the device from being mounted, repartitioned or otherwise reused by a RAID array (or any other kernel subsystem), by bd_claiming the device. */
static int lock_rdev(mdk_rdev_t *rdev, dev_t dev, int shared)
/* prevent the device from being mounted, repartitioned or otherwise reused by a RAID array (or any other kernel subsystem), by bd_claiming the device. */ static int lock_rdev(mdk_rdev_t *rdev, dev_t dev, int shared)
{ int err = 0; struct block_device *bdev; char b[BDEVNAME_SIZE]; bdev = open_by_devnum(dev, FMODE_READ|FMODE_WRITE); if (IS_ERR(bdev)) { printk(KERN_ERR "md: could not open %s.\n", __bdevname(dev, b)); return PTR_ERR(bdev); } err = bd_claim(bdev, shared ? (mdk_rdev_t *)lock_rdev : rdev); if (err) { printk(KERN_ERR "md: could not bd_claim %s.\n", bdevname(bdev, b)); blkdev_put(bdev, FMODE_READ|FMODE_WRITE); return err; } if (!shared) set_bit(AllReserved, &rdev->flags); rdev->bdev = bdev; return err; }
robutest/uclinux
C++
GPL-2.0
60
/* DMA Channel Disable Interrupt on Transfer Half Complete. */
void dma_disable_half_transfer_interrupt(uint32_t dma, uint8_t channel)
/* DMA Channel Disable Interrupt on Transfer Half Complete. */ void dma_disable_half_transfer_interrupt(uint32_t dma, uint8_t channel)
{ DMA_CCR(dma, channel) &= ~DMA_CCR_HTIE; }
insane-adding-machines/unicore-mx
C++
GNU General Public License v3.0
50
/* If 16-bit I/O port operations are not supported, then ASSERT(). If Port is not aligned on a 16-bit boundary, then ASSERT(). */
UINT16 EFIAPI IoAndThenOr16(IN UINTN Port, IN UINT16 AndData, IN UINT16 OrData)
/* If 16-bit I/O port operations are not supported, then ASSERT(). If Port is not aligned on a 16-bit boundary, then ASSERT(). */ UINT16 EFIAPI IoAndThenOr16(IN UINTN Port, IN UINT16 AndData, IN UINT16 OrData)
{ return IoWrite16 (Port, (UINT16)((IoRead16 (Port) & AndData) | OrData)); }
tianocore/edk2
C++
Other
4,240
/* Waits for up to @timeout jiffies for a backing_dev (any backing_dev) to exit write congestion. If no backing_devs are congested then just wait for the next write to be completed. */
long congestion_wait(int sync, long timeout)
/* Waits for up to @timeout jiffies for a backing_dev (any backing_dev) to exit write congestion. If no backing_devs are congested then just wait for the next write to be completed. */ long congestion_wait(int sync, long timeout)
{ long ret; DEFINE_WAIT(wait); wait_queue_head_t *wqh = &congestion_wqh[sync]; prepare_to_wait(wqh, &wait, TASK_UNINTERRUPTIBLE); ret = io_schedule_timeout(timeout); finish_wait(wqh, &wait); return ret; }
robutest/uclinux
C++
GPL-2.0
60
/* This method will free @invocation, you cannot use it afterwards. */
void _g_freedesktop_dbus_complete_list_queued_owners(_GFreedesktopDBus *object, GDBusMethodInvocation *invocation, const gchar *const *queued_owners)
/* This method will free @invocation, you cannot use it afterwards. */ void _g_freedesktop_dbus_complete_list_queued_owners(_GFreedesktopDBus *object, GDBusMethodInvocation *invocation, const gchar *const *queued_owners)
{ g_dbus_method_invocation_return_value (invocation, g_variant_new ("(^as)", queued_owners)); }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* Fetches the chassis power supply/supplies status when last booted. */
MISC_CHASSIS_STATE EFIAPI OemGetChassisPowerSupplyState(VOID)
/* Fetches the chassis power supply/supplies status when last booted. */ MISC_CHASSIS_STATE EFIAPI OemGetChassisPowerSupplyState(VOID)
{ ASSERT (FALSE); return ChassisStateSafe; }
tianocore/edk2
C++
Other
4,240
/* Register the Service A and all its Characteristics... */
void service_a_3_init(void)
/* Register the Service A and all its Characteristics... */ void service_a_3_init(void)
{ bt_gatt_service_register(&service_a_3_svc); }
zephyrproject-rtos/zephyr
C++
Apache License 2.0
9,573
/* Converts a flow control enum value to a Modem Control Register bit mask. It is assumed that the Modem Control Register contents that are being modified within this function come with the bits modified by this function already masked out by the caller. */
static bool uart_xlnx_ps_cfg2ll_hwctrl(uint32_t *modemcr_reg, enum uart_config_flow_control hwctrl)
/* Converts a flow control enum value to a Modem Control Register bit mask. It is assumed that the Modem Control Register contents that are being modified within this function come with the bits modified by this function already masked out by the caller. */ static bool uart_xlnx_ps_cfg2ll_hwctrl(uint32_t *modemcr_reg, enum uart_config_flow_control hwctrl)
{ if (hwctrl == UART_CFG_FLOW_CTRL_RTS_CTS) { *modemcr_reg |= XUARTPS_MODEMCR_FCM_RTS_CTS; } else if (hwctrl == UART_CFG_FLOW_CTRL_NONE) { *modemcr_reg |= XUARTPS_MODEMCR_FCM_NONE; } else { return false; } return true; }
zephyrproject-rtos/zephyr
C++
Apache License 2.0
9,573
/* The SRAT table always lists ascending addresses, so can always assume that the first "start" address that you see is the real start of the node, and that the current "end" address is after the previous one. */
static __init int node_read_chunk(int nid, struct node_memory_chunk_s *memory_chunk)
/* The SRAT table always lists ascending addresses, so can always assume that the first "start" address that you see is the real start of the node, and that the current "end" address is after the previous one. */ static __init int node_read_chunk(int nid, struct node_memory_chunk_s *memory_chunk)
{ if (memory_chunk->start_pfn >= max_pfn) { printk(KERN_INFO "Ignoring SRAT pfns: %08lx - %08lx\n", memory_chunk->start_pfn, memory_chunk->end_pfn); return -1; } if (memory_chunk->nid != nid) return -1; if (!node_has_online_mem(nid)) node_start_pfn[nid] = memory_chunk->start_pfn; if (node_start_pfn[nid] > memory_chunk->start_pfn) node_start_pfn[nid] = memory_chunk->start_pfn; if (node_end_pfn[nid] < memory_chunk->end_pfn) node_end_pfn[nid] = memory_chunk->end_pfn; return 0; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Installs the hardware constraint rules to prevent using double rates and more than two channels at the same time. */
int snd_ac97_pcm_double_rate_rules(struct snd_pcm_runtime *runtime)
/* Installs the hardware constraint rules to prevent using double rates and more than two channels at the same time. */ int snd_ac97_pcm_double_rate_rules(struct snd_pcm_runtime *runtime)
{ int err; err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, double_rate_hw_constraint_rate, NULL, SNDRV_PCM_HW_PARAM_CHANNELS, -1); if (err < 0) return err; err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, double_rate_hw_constraint_channels, NULL, SNDRV_PCM_HW_PARAM_RATE, -1); return err; }
robutest/uclinux
C++
GPL-2.0
60
/* Switch the requested AP to be the BSP from that point onward. */
EFI_STATUS MpServicesUnitTestSwitchBSP(IN MP_SERVICES MpServices, IN UINTN ProcessorNumber, IN BOOLEAN EnableOldBSP)
/* Switch the requested AP to be the BSP from that point onward. */ EFI_STATUS MpServicesUnitTestSwitchBSP(IN MP_SERVICES MpServices, IN UINTN ProcessorNumber, IN BOOLEAN EnableOldBSP)
{ return MpServices.Ppi->SwitchBSP (MpServices.Ppi, ProcessorNumber, EnableOldBSP); }
tianocore/edk2
C++
Other
4,240
/* Log error information to system console. Filter out the device not there errors. PCI: EADs Connect Failed 0x Rc: 0x00xx PCI: Read Vendor Failed 0x Rc: 0x00xx PCI: Connect Bus Unit Failed 0x Rc: 0x00xx */
static void pci_log_error(char *error, int bus, int subbus, int agent, int hv_res)
/* Log error information to system console. Filter out the device not there errors. PCI: EADs Connect Failed 0x Rc: 0x00xx PCI: Read Vendor Failed 0x Rc: 0x00xx PCI: Connect Bus Unit Failed 0x Rc: 0x00xx */ static void pci_log_error(char *error, int bus, int subbus, int agent, int hv_res)
{ if (hv_res == 0x0302) return; printk(KERN_ERR "PCI: %s Failed: 0x%02X.%02X.%02X Rc: 0x%04X", error, bus, subbus, agent, hv_res); }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Returns: TRUE on success, FALSE if an error occurred */
gboolean g_thread_pool_push(GThreadPool *pool, gpointer data, GError **error)
/* Returns: TRUE on success, FALSE if an error occurred */ gboolean g_thread_pool_push(GThreadPool *pool, gpointer data, GError **error)
{ GRealThreadPool *real; gboolean result; real = (GRealThreadPool*) pool; g_return_val_if_fail (real, FALSE); g_return_val_if_fail (real->running, FALSE); result = TRUE; g_async_queue_lock (real->queue); if (g_async_queue_length_unlocked (real->queue) >= 0) { GError *local_error = NULL; if (!g_thread_pool_start_thread (real, &local_error)) { g_propagate_error (error, local_error); result = FALSE; } } g_thread_pool_queue_push_unlocked (real, data); g_async_queue_unlock (real->queue); return result; }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* This function finds a usb class driver by specified class code and subclass code. */
ucd_t rt_usbh_class_driver_find(int class_code, int subclass_code)
/* This function finds a usb class driver by specified class code and subclass code. */ ucd_t rt_usbh_class_driver_find(int class_code, int subclass_code)
{ struct rt_list_node *node; if (rt_thread_self() != RT_NULL) rt_enter_critical(); for (node = _driver_list.next; node != &_driver_list; node = node->next) { ucd_t drv = (ucd_t)rt_list_entry(node, struct uclass_driver, list); if (drv->class_code == class_code) { if (rt_thread_self() != RT_NULL) rt_exit_critical(); return drv; } } if (rt_thread_self() != RT_NULL) rt_exit_critical(); return RT_NULL; }
pikasTech/PikaPython
C++
MIT License
1,403
/* Since this file should be linked before any other machine specific file, the __initcall() here will be executed first. This serves as default initialization stuff for PXA machines which can be overridden later if need be. */
void clear_reset_status(unsigned int mask)
/* Since this file should be linked before any other machine specific file, the __initcall() here will be executed first. This serves as default initialization stuff for PXA machines which can be overridden later if need be. */ void clear_reset_status(unsigned int mask)
{ if (cpu_is_pxa2xx()) pxa2xx_clear_reset_status(mask); if (cpu_is_pxa3xx()) pxa3xx_clear_reset_status(mask); }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Calculate how many bytes are needed by the slot map. Returns an error if the slot map file is too small. */
static int ocfs2_slot_map_physical_size(struct ocfs2_super *osb, struct inode *inode, unsigned long long *bytes)
/* Calculate how many bytes are needed by the slot map. Returns an error if the slot map file is too small. */ static int ocfs2_slot_map_physical_size(struct ocfs2_super *osb, struct inode *inode, unsigned long long *bytes)
{ unsigned long long bytes_needed; if (ocfs2_uses_extended_slot_map(osb)) { bytes_needed = osb->max_slots * sizeof(struct ocfs2_extended_slot); } else { bytes_needed = osb->max_slots * sizeof(__le16); } if (bytes_needed > i_size_read(inode)) { mlog(ML_ERROR, "Slot map file is too small! (size %llu, needed %llu)\n", i_size_read(inode), bytes_needed); return -ENOSPC; } *bytes = bytes_needed; return 0; }
robutest/uclinux
C++
GPL-2.0
60
/* Flush write buffers on the bus path to the mesh */
static void mesh_flush_io(volatile struct mesh_regs __iomem *mr)
/* Flush write buffers on the bus path to the mesh */ static void mesh_flush_io(volatile struct mesh_regs __iomem *mr)
{ (void)in_8(&mr->mesh_id); }
robutest/uclinux
C++
GPL-2.0
60
/* Feature negotiation lists rely on and maintain the following invariants: */
static struct dccp_feat_entry* dccp_feat_list_lookup(struct list_head *fn_list, u8 feat_num, bool is_local)
/* Feature negotiation lists rely on and maintain the following invariants: */ static struct dccp_feat_entry* dccp_feat_list_lookup(struct list_head *fn_list, u8 feat_num, bool is_local)
{ struct dccp_feat_entry *entry; list_for_each_entry(entry, fn_list, node) { if (entry->feat_num == feat_num && entry->is_local == is_local) return entry; else if (entry->feat_num > feat_num) break; } return NULL; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Allow to know if a motion was detected. */
uint32_t re200b_motion_detection(void)
/* Allow to know if a motion was detected. */ uint32_t re200b_motion_detection(void)
{ return (g_ul_compare_event_flag && (g_compare_result == CMP_GREATER)); }
remotemcu/remcu-chip-sdks
C++
null
436
/* AtomicWriteFile-ACK ::= SEQUENCE { endOfFile BOOLEAN, accessMethod CHOICE { streamAccess SEQUENCE { fileStartPosition INTEGER, fileData OCTET STRING }, recordAccess SEQUENCE { fileStartRecord INTEGER, returnedRecordCount Unsigned, fileRecordData SEQUENCE OF OCTET STRING } } } */
static guint fAtomicReadFileAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset)
/* AtomicWriteFile-ACK ::= SEQUENCE { endOfFile BOOLEAN, accessMethod CHOICE { streamAccess SEQUENCE { fileStartPosition INTEGER, fileData OCTET STRING }, recordAccess SEQUENCE { fileStartRecord INTEGER, returnedRecordCount Unsigned, fileRecordData SEQUENCE OF OCTET STRING } } } */ static guint fAtomicReadFileAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset)
{ offset = fApplicationTypes(tvb, pinfo, tree, offset, "End Of File: "); offset = fAccessMethod(tvb, pinfo, tree, offset); return offset; }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* This API provides a way to allocate memory for page table. */
VOID* AllocatePageTableMemory(IN UINTN Pages)
/* This API provides a way to allocate memory for page table. */ VOID* AllocatePageTableMemory(IN UINTN Pages)
{ VOID *Address; Address = AllocatePages (Pages); if (Address != NULL) { ZeroMem (Address, EFI_PAGES_TO_SIZE (Pages)); } return Address; }
tianocore/edk2
C++
Other
4,240
/* Return # of addresses in a Curl_addrinfo struct */
int Curl_num_addresses(const Curl_addrinfo *addr)
/* Return # of addresses in a Curl_addrinfo struct */ int Curl_num_addresses(const Curl_addrinfo *addr)
{ int i = 0; while(addr) { addr = addr->ai_next; i++; } return i; }
alibaba/AliOS-Things
C++
Apache License 2.0
4,536
/* This function will program the internal Vref setting in a given byte lane in a given channel. */
void set_vref(uint8_t channel, uint8_t byte_lane, uint32_t setting)
/* This function will program the internal Vref setting in a given byte lane in a given channel. */ void set_vref(uint8_t channel, uint8_t byte_lane, uint32_t setting)
{ uint32_t reg = (byte_lane & 0x1) ? B1VREFCTL : B0VREFCTL; ENTERFN(); DPF(D_TRN, "Vref ch%d ln%d : val=%03X\n", channel, byte_lane, setting); mrc_alt_write_mask(DDRPHY, reg + channel * DDRIODQ_CH_OFFSET + (byte_lane >> 1) * DDRIODQ_BL_OFFSET, vref_codes[setting] << 2, 0xfc); delay_n(300); LEAVEFN(); }
4ms/stm32mp1-baremetal
C++
Other
137
/* Only valid for transactions that are potentially pending (ie have been sent). */
int fw_cancel_transaction(struct fw_card *card, struct fw_transaction *transaction)
/* Only valid for transactions that are potentially pending (ie have been sent). */ int fw_cancel_transaction(struct fw_card *card, struct fw_transaction *transaction)
{ if (card->driver->cancel_packet(card, &transaction->packet) == 0) return 0; return close_transaction(transaction, card, RCODE_CANCELLED); }
robutest/uclinux
C++
GPL-2.0
60
/* Spin wait for MSTATUS bit to be set, and clear it afterwards. Note that this spins forever waiting for bits to be set, and to be cleared. */
static void mcux_i3c_status_wait_clear(I3C_Type *base, uint32_t mask)
/* Spin wait for MSTATUS bit to be set, and clear it afterwards. Note that this spins forever waiting for bits to be set, and to be cleared. */ static void mcux_i3c_status_wait_clear(I3C_Type *base, uint32_t mask)
{ mcux_i3c_status_wait(base, mask); mcux_i3c_status_clear(base, mask); }
zephyrproject-rtos/zephyr
C++
Apache License 2.0
9,573