1.6+ IDE new spi library (for multiple slaves);

Just like to share my input on sharing multiple slave SPI devices on the same bus, the new SPI library is working excellent and it's a matter of time before "active" contributors of libraries implement it in their code.

My issue was with running the CANBUS and MCP23S17 libraries, they worked alone, but not together.
After doing a little research, and playing with pullups, nothing worked, and finding out why is not so easy for everyone, so I hope you all can benefit in tweaking your own libraries to implement the new SPI code

There are NO changes to make in your libraries, just additions:

First you must edit your *.cpp file, no need to edit the others...
in my case: MCP23S17.cpp

At the top of the file I added a #define so if I ever needed to change the clock of the SPI I wouldnt have to edit all the locations I put the code:

#define MCP23S17_SETTING SPISettings(4000000,MSBFIRST,SPI_MODE0)
^-- This was failing at 8000000(8MHz). When I changed to 4MHz, everything worked.

Next, to help you put the code throughout the library, use the Find and search for " HIGH); "
This should bring you to one (maybe more) locations of when the CS is being asserted, or not.
You will see this as an example:

void MCP23S17::begin() {
    _spi->begin();
    ::pinMode(_cs, OUTPUT);
    ::digitalWrite(_cs, HIGH);
    uint8_t cmd = 0b01000000;
   ::digitalWrite(_cs, LOW);
    _spi->transfer(cmd);
    _spi->transfer(IOCONA);
    _spi->transfer(0x18);
    ::digitalWrite(_cs, HIGH);
    writeAll();
}

I added 2 lines of code:

void MCP23S17::begin() {
    _spi->begin();
    ::pinMode(_cs, OUTPUT);
    ::digitalWrite(_cs, HIGH);
    uint8_t cmd = 0b01000000;
	[b]SPI.beginTransaction(MCP23S17_SETTING);[/b]
    ::digitalWrite(_cs, LOW);
    _spi->transfer(cmd);
    _spi->transfer(IOCONA);
    _spi->transfer(0x18);
    ::digitalWrite(_cs, HIGH);
	[b]SPI.endTransaction();[/b]
    writeAll();
}

Here is another section of the same CPP file for an example:

void MCP23S17::writeRegister(uint8_t addr) {
if (addr > 21) {
return;
}
uint8_t cmd = 0b01000000 | ((_addr & 0b111) << 1);
SPI.beginTransaction(MCP23S17_SETTING);
::digitalWrite(_cs, LOW);
_spi->transfer(cmd);
_spi->transfer(addr);
_spi->transfer(_reg[addr]);
::digitalWrite(_cs, HIGH);
SPI.endTransaction();
}

To make it easy to know where and when to place it, just remember this:
SPI.beginTransaction is placed right before the CS line is driven low,
and SPI.endTransaction is placed right after the CS line is driven high.

This took less than 10 minutes to edit both CPP files and they are working excellent together now.

Previously , for the CANBUS I used 8MHz, the MCP23S17 did not like it and gave errors, and the CANBUS gave errors when ran at 4MHz, so this new SPI library is working great.

And, the CANBUS Example:

Set 8MHz for canbus

#define MCP2515_SETTING SPISettings(8000000,MSBFIRST,SPI_MODE0)
void MCP_CAN::mcp2515_reset(void)
{
    SPI.beginTransaction(MCP2515_SETTING);
    MCP2515_SELECT();
    spi_readwrite(MCP_RESET);
    MCP2515_UNSELECT();
    SPI.endTransaction();
    delay(10);
}

... and don't forget the rest of the CPP file to inject your SPI.begin/endTransaction code.

Hope I simplified it for most of you