invert ClockPin on shiftout

hi. becouse i'm gonna use 32 shift registers (a big static display) i need to make signals stronger, so i will add a transistor to improve current on clockpin and latchpin pins of arduino.

as you know transistor's change logic. so this code:

    digitalWrite(latchPin, LOW);
    shiftOut(dataPin, clockPin, LSBFIRST, B10101010);   
    digitalWrite(latchPin, HIGH);

I will change it to:

    digitalWrite(latchPin, HIGH);
    shiftOut(dataPin, clockPin, LSBFIRST, B10101010);   
    digitalWrite(latchPin, LOW);

by this i am changing the logic of latchpin so transitor will change them back to the correct logic.

the problem is on clockpin. can anyone make a new function that changes the logic of clockpin?

something like my_shiftOut(dataPin,clockPin,LSBFIRST,B10101010). but on this routine clockpin=-clockpin

i hope you have understand

sorry for my bad english

Try this:-

void invertShiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val)
{
	uint8_t i;

	for (i = 0; i < 8; i++)  {
		if (bitOrder == LSBFIRST)
			digitalWrite(dataPin, !!(val & (1 << i)));
		else	
			digitalWrite(dataPin, !!(val & (1 << (7 - i))));
			
		digitalWrite(clockPin, LOW);
		digitalWrite(clockPin, HIGH);
		
	}
}