This file contains hidden or 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
/* https://github.com/adafruit/circuitpython/blob/22889ca29a9a8498fd7ba49260e988bfa5ac7011/ports/atmel-samd/common-hal/audioio/AudioOut.c#L377 */ | |
mp_raise_ValueError_varg(translate("Sample rate too high. It must be less than %d"), max_sample_rate); |
This file contains hidden or 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> | |
void test_1(void); | |
void test_2(void); | |
void test_3(void); | |
#define USE_TEST(x) (test_##x()) | |
int main(void) { | |
This file contains hidden or 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
/******************************************************************** | |
* * | |
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * | |
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * | |
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * | |
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * | |
* * | |
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * | |
* by the Xiph.Org Foundation http://www.xiph.org/ * | |
* * |
This file contains hidden or 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
// This doesn't work (result in a halt handler) on a Cortex M0 based microcontroller, f_read expect an unsigned int as the last parameter | |
uint8_t bytesRead = 0; | |
res = f_read(&MyFile, &wav_test.riff, sizeof wav_test.riff, &bytesRead); | |
// But it does 'work' in the other Cortex M microcontrollers. |
This file contains hidden or 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
#!/usr/bin/python3 | |
oggDataArray = [] | |
ogg_decoded_file = 'ogg_decoded' | |
output_file = 'test.c' | |
print('Opening {}.'.format(ogg_decoded_file)) | |
with open(ogg_decoded_file, 'rb') as f: |
This file contains hidden or 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 "project.h" | |
#include <string.h> | |
enum { | |
MAX_ITEMS = 10, | |
}; | |
typedef enum { | |
TX_IDLE, | |
TX_TRANSFERING, |
This file contains hidden or 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 <stdlib.h> | |
#define NAME(x) "Hola " #x | |
#define MSG(x) NAME(x) | |
int main(void) | |
{ | |
printf("%s\r\n", MSG(World)); | |
This file contains hidden or 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
// vtable | |
struct nrf_spi_operations { | |
uint8_t (*spi_read)(void); | |
void (*spi_write)(uint8_t data); | |
} | |
// microcontroller A | |
uint8_t microA_spi_read(void); | |
void microA_spi_write(uint8_t data); |
This file contains hidden or 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
// Mandatory configuration | |
#ifndef configMINIMAL_STACK_SIZE | |
#error Missing definition: configMINIMAL_STACK_SIZE must be defined in FreeRTOSConfig.h. configMINIMAL_STACK_SIZE defines the size (in words) of the stack allocated to the idle task. Refer to the demo project provided for your port for a suitable value. | |
#endif | |
#ifndef configMAX_PRIORITIES | |
#error Missing definition: configMAX_PRIORITIES must be defined in FreeRTOSConfig.h. See the Configuration section of the FreeRTOS API documentation for details. | |
#endif | |
#ifndef configUSE_PREEMPTION |
This file contains hidden or 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
#!/bin/bash | |
qemu-system-aarch64 \ | |
-machine virt \ | |
-cpu cortex-a57 \ | |
-nographic -smp 1 \ | |
-m 2048 \ | |
-kernel ./linux-4.8.11/arch/arm64/boot/Image \ | |
--append "console=ttyAMA0" \ | |
$1 $2 |