This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
char *strtok(char *str, const char *delimiters) | |
{ | |
char *token = NULL; | |
static char *begin = NULL; | |
if(str != NULL) | |
{ | |
begin = str; | |
} | |
else | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
****************************************************************************** | |
* @file Project/main.c | |
* @author MCD Application Team | |
* @version V2.3.0 | |
* @date 16-June-2017 | |
* @brief Main program body | |
****************************************************************************** | |
* @attention | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @file | |
* | |
* @ingroup arm | |
* | |
* @brief RTC driver for STM32F4 SoC. | |
* | |
*/ | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void rtc_init(int minor) | |
{ | |
printk("rtc \n"); | |
volatile uint32_t *RCC_APB1ENR = 0x40023840; | |
volatile uint32_t *RCC_BDCR = 0x40023870; | |
uint16_t retry = 0X1FFF; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uint32_t *USART2_SR = (uint32_t *)0x40004400; | |
uint32_t *USART2_DR = (uint32_t *)0x40004404; | |
rtems_isr USART2_handler(rtems_vector_number vector) | |
{ | |
uint32_t temp = temp; | |
if((*USART2_SR) & (1<<5)) | |
{ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stm32f4_gpio_config io_key2 = | |
{ | |
.fields={ | |
.pin_first = STM32F4_GPIO_PIN(4, 2), | |
.pin_last = STM32F4_GPIO_PIN(4, 2), | |
.mode = STM32F4_GPIO_MODE_INPUT, | |
//.otype = STM32F4_GPIO_OTYPE_PUSH_PULL, | |
.ospeed = STM32F4_GPIO_OSPEED_2_MHZ, | |
.pupd = STM32F4_GPIO_PULL_UP, | |
.output = 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
cheng@ubuntu:~/rtems-4.11.3/testsuites/samples/hello$ tree | |
. | |
├── hello.doc | |
├── hello.scn | |
├── init__0402.c | |
├── init0403.c | |
├── init.c | |
├── init.c_0001 | |
├── init.c_0002 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "keymap_common.h" | |
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |
/* 0: numpad */ | |
KEYMAP( NLCK, SLASH, PAST, PMNS, \ | |
P7, P8, P9, PENT, \ | |
P4, P5, P6, \ | |
P1, P2, P3, \ | |
P0, PDOT, PPLS), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cheng@ada ~ $ cat /etc/rc.local | |
#!/bin/sh -e | |
# | |
# rc.local | |
# | |
# This script is executed at the end of each multiuser runlevel. | |
# Make sure that the script will "exit 0" on success or any other | |
# value on error. | |
# | |
# In order to enable or disable this script just change the execution |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <iconv.h> | |
#include <string.h> | |
#include <errno.h> | |
#include <stdint.h> | |
int conv_utf8_to_ucs2(const char* src, size_t len) | |
{ | |
iconv_t cb = iconv_open("UTF-16", "UTF-8"); | |
if (cb == (iconv_t)(-1)) |
NewerOlder