<commit_before>//#include <WProgram.h>

#include <SPI.h>
#include <DmaSpi.h>

/** Important
  The sketch waits for user input through Serial (USB) before it starts the setup.
  After any key was pressed, it should begin to work. It will ask for a second keypress later.
  
  This example cannot simply be modified to use SPI0 or SPI2 instead of SPI1 because ActiveLowChipSelect1 is
  hardcoded to use SPI1.
  If you want to use SPI0: see DMASpi_example1.
  If you want to use SPI2: adapt example and create a new chip select class.
**/

/** Hardware setup:
 Teensy LC: DOUT (pin 0) connected to DIN (pin 1)
 Teensy 3.5, 3.6: DOUT (pin 0) connected to DIN (pin 1)
 Pin 0 is used as a chip select pin, don't connect anything there.
**/

/** buffers to send from and to receive to **/
#define DMASIZE 100
uint8_t src[DMASIZE];
volatile uint8_t dest[DMASIZE];
volatile uint8_t dest1[DMASIZE];

/** Wait for and consume a keypress over USB **/
void waitForKeyPress()
{
  Serial.println("\nPress a key to continue\n");
  while(!Serial.available());
  while(Serial.available())
  {
    Serial.read();
  }
}

void dumpBuffer(const volatile uint8_t* buf, const char* prefix)
{
  Serial.print(prefix);
  for (size_t i = 0; i < DMASIZE; i++)
  {
    Serial.printf("0x%02x ", buf[i]);
  }
  Serial.print('\n');
}<commit_msg>Update DMASpi_example2.ino<commit_after>//#include <WProgram.h>

#include <SPI.h>
#include <DmaSpi.h>

/** Important
  The sketch waits for user input through Serial (USB) before it starts the setup.
  After any key was pressed, it should begin to work. It will ask for a second keypress later.
  
  This example cannot simply be modified to use SPI0 or SPI2 instead of SPI1 because ActiveLowChipSelect1 is
  hardcoded to use SPI1.
  If you want to use SPI0: see DMASpi_example1.
  If you want to use SPI2: adapt example and create a new chip select class.
**/

/** Hardware setup:
 Teensy LC: DOUT (pin 0) connected to DIN (pin 1)
 Teensy 3.5, 3.6: DOUT (pin 0) connected to DIN (pin 1)
 Pin 2 is used as a chip select pin, don't connect anything there.
**/

/** buffers to send from and to receive to **/
#define DMASIZE 100
uint8_t src[DMASIZE];
volatile uint8_t dest[DMASIZE];
volatile uint8_t dest1[DMASIZE];

/** Wait for and consume a keypress over USB **/
void waitForKeyPress()
{
  Serial.println("\nPress a key to continue\n");
  while(!Serial.available());
  while(Serial.available())
  {
    Serial.read();
  }
}

void dumpBuffer(const volatile uint8_t* buf, const char* prefix)
{
  Serial.print(prefix);
  for (size_t i = 0; i < DMASIZE; i++)
  {
    Serial.printf("0x%02x ", buf[i]);
  }
  Serial.print('\n');
}
{'fraction_non_alphanumeric': 0.11186954872961699, 'fraction_numerical': 0.022373909745923397, 'mean_word_length': 3.736086175942549, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2263589', 'n_tokens_mistral': 915, 'n_tokens_neox': 889, 'n_words': 353}