My AT90USB1287 is normally working on battery power, self powered.
When it will be connect to an usb port it's should be powered from the usb port. To achieve this my idea was to add some fet's.
The fet(N-channel) on the left should connect VCC to VBUS and the fet (P-channel) on the right must disconnect the battery from VCC.
Is the idea good and should it work without frying everything.