Problem with SPI Master-Slave Arduino to Arduino communication

Hello, in an urgent need for help - I am attempting to make 2 Arduinos communicate with Uno as the master and Leonardo as the slave. When a wrong message is sent to slave, it should trigger a pin interrupt on the master, stopping its operations.

I cannot seem to get the SPI working at all - the SPI clock when probed is flat at 0V. It does not clock out any pulse. What's wrong with my code?

The code for Master is as follows

#include <SPI.h>

#define clk_m 13
#define miso_m 12
#define mosi_m 11

#define watchSS 7 //slave select pin
#define wdpin 2 //interrupt pin

int clr;

void setup(void)
{
  Serial.begin (9600);
  
  pinMode(clk_m, OUTPUT);
  pinMode(miso_m, INPUT);
  pinMode(mosi_m, OUTPUT);
  pinMode(watchSS, OUTPUT);
  pinMode(wdpin, INPUT);
   
  digitalWrite(clk_m, LOW);
  digitalWrite(mosi_m, LOW);
  digitalWrite(miso_m, LOW);
  digitalWrite(watchSS, HIGH);  // ensure SS stays high for now
  
  SPCR |= _BV(MSTR);
  SPCR |= _BV(SPE);
  clr = SPSR;
  clr = SPDR;
  delay(10);

  // Slow down the master a bit
  SPI.setClockDivider(SPI_CLOCK_DIV32);
  
  EICRA &= ~3; //clear existing flags
  EICRA |= 2; //set wanted flags (falling level interrupt)
  EIMSK |= 1; //enable it  
    
  Serial.println ("Test for Master of Watchdog");
  
  delay(50);
}  // end of setup

ISR(INT0_vect)
{
  Serial.println("interrupt");
  while(digitalRead(wdpin) == LOW);
}

void loop (void)
{
  EIFR = 1;
  // enable Slave Select
  digitalWrite(watchSS, LOW); 
  SPI.transfer(5);
  digitalWrite(watchSS, HIGH);
  
  delay(100);
  
  digitalWrite(watchSS, LOW);
  SPI.transfer(5);
  digitalWrite(watchSS, HIGH);
  
  Serial.println ("successful exit");
  
  delay (500); 
}  // end of loop

and for the Slave:

#include <SPI.h>

#define clk_s 13
#define miso_s 12
#define mosi_s 11
#define watchSS 10

#define wdpin 8

void setup (void)
{

  // have to send on master in, *slave out*
  Serial.begin(9600);

  pinMode(clk_s, INPUT);
  pinMode(mosi_s, INPUT);
  pinMode(miso_s, OUTPUT);
  pinMode(watchSS, INPUT);
  
  pinMode(wdpin, OUTPUT);
  digitalWrite(wdpin, HIGH);
  
  // turn on SPI in slave mode
  SPCR |= _BV(SPE);

  // turn on interrupts
  SPCR |= _BV(SPIE);
  
  delay(500);

}  // end of setup

void loop (void)
{
  while (digitalRead(watchSS) == HIGH);
  
  while (digitalRead(watchSS) == LOW)
  {
    byte data_in = SPDR;
    if (data_in != 5)
    {
      digitalWrite(wdpin, LOW);
    }
    else
    {
      digitalWrite(wdpin, HIGH);
    }
  }
}  // end of loop

Thanks!

Your master code does not contain a SPI.begin() call. You copied the parts out that you think are relevant but you cannot omit the pinMode() call for the SS pin because the hardware depends on it. You cannot use pin 10 (on the UNO) as an Input while using the hardware SPI to transmit data as a master.

The pins for the leonardo are on the ISP header, not found anywhere else. So your slave code won't work on a leonardo.
However I have not been able to get the leonardo to work as a slave, and I think it is because it is physically connected to the Rx led.