19.8.2.2.1 Code

Add the following to your user application main().
while(spi_read_buffer_wait(&spi_slave_instance, buffer_rx, BUF_LENGTH,
    0x00) != STATUS_OK) {
    /* Wait for transfer from the master */
}
for (uint8_t i = 0; i < BUF_LENGTH; i++) {
    if(buffer_rx[i] != buffer_expect[i]) {
        result++;
    }
}
while (true) {
    /* Infinite loop */     
    if (result) {
        port_pin_toggle_output_level(LED_0_PIN);
        /* Add a short delay to see LED toggle */
        volatile uint32_t delay = 30000;
        while(delay--) {
        }
    } else {
        port_pin_toggle_output_level(LED_0_PIN);
        /* Add a short delay to see LED toggle */
        volatile uint32_t delay = 600000;
        while(delay--) {
        }
    }
}