Wikipedia mentions that they took 1200 people prisoner from Porto Santo, but little else. Do we know what happened to these people? Do we know whether the invaders were officially part of the Ottoman Navy, or simply Barbary corsairs flying the Ottoman flag? What was the goal of the landing - to capture slaves, annoy Portugal, or something else? Are there any signs of this brief occupation in the archipelago, and has it had any notable impact on the history of the islands?
I'd love to hear any extant information about this, even if sources are scant.
This is one of those factoids that while in general it is true, it has managed to have almost every single minor detail of it changed somewhat, which may eventually lead people to make some wrong conclusions.
So the event closely following the story really did happen in 1617 to a Portuguese island, but it was not Madeira itself, but the smaller island of Porto Santo which is really close to Madeira and part of the Madeira archipelago. It was attacked by 8 (or 9) ships of pirates of Algiers, which was nominally under Ottoman suzerainty but I find calling them "Ottoman navy" doesn't do justice to the complicated relationship between them
It also wasn't really an occupation, nor was it intended to be. It was a raid, that after successful breaking of the initial resistance, attackers were left unopposed and spent at most several days looting and rounding up the people, after which they set fire to everything and left.
Even the number of captives as 1200 is a bit off, as the initial record claims around 900 men and women taken from the island back to Algiers as slaves. I think the number of 1200 arrived from joining the 222 men and women taken in the same way from the island Santa Maria in the Azores, which happened in preceding year of 1616.
Honestly, that it is pretty much all of the information I have on the raid. I really don't know anything about the pirates who conducted the raid, other then the rumor was one of the leaders was a Renegade christian (converted to Islam and joined the pirates) but it really might not be the case. The people were taken back to Algiers where they were kept as captives and slaves. At least some (either one third or 2/3) of captives from the 1616 raid of Santa Maria managed to eventually return, and similar thing could happen to some of the captives of Porto Santo, but most likely majority remained slaves for the rest of their life.
But the possibility existed as Algerian pirates held such captives exactly to be exchanged or ransomed out by their family and friends. There was also an organized effort by Portuguese and Spanish church which was collecting alms to buy back captives whose families were too poor to be saved. Still not all would have the luck to be saved. Sadly, I don't know any details of this efforts and their work, even though it would be an interesting topic to read about!
Regarding the effect the raid had on the islands in general (Porto Santo was completely depopulated), it was substantial even though the island was never really controlled by the Ottomans to create some longer term political changes. But the fear these raids sparked in the local population was massive, despite the Portuguese islands of the Atlantic already being subject to raids by various European players, like French, English, Dutch.
But this raid was one of the first of the Barbary pirates themselves passed the Straits of Gibraltar in the Atlantic, and more ferocious then the previous European raids which were more after booty and loot and not slaves. The locals of Funchal, Madeira were much startled by the realization that the central authorities lack the ability to protect them, and continued their halted program of buildup of defense and fortresses, as best as they could. In broader, long term picture, in Portugal attacks were few of many that sparked further resentment against the Spanish rule of the Iberian Union, which seemingly dedicated resources to pursuit of their own interests while inadequately protecting Portuguese holdings. This factored in heavily in the later decision of Portugal to seek independence.
The main source for this is article in Portuguese O Saque Dos Argelinos À Ilha Do Porto Santo Em 1617 by Jorge Valdemar Guerra available here