-
PROHARDVER!
Arduino hardverrel és szoftverrel foglakozó téma. Minden mikrovezérlő ami arduinoval programozható, és minden arduino program, board, és hardverrel kapcsolatos kérdések helye.
Új hozzászólás Aktív témák
-
Janos250
őstag
válasz
gyapo11 #3366 üzenetére
"én pl. még nem láttam azt a kódot, ami akkor fog lefutni, amikor ezt a sort hajtja végre és küldi ki a soros portra a byte-okat"
Tessék:
size_t HardwareSerial::write(uint8_t c)
{
_written = true;
// If the buffer and the data register is empty, just write the byte
// to the data register and be done. This shortcut helps
// significantly improve the effective datarate at high (>
// 500kbit/s) bitrates, where interrupt overhead becomes a slowdown.
if (_tx_buffer_head == _tx_buffer_tail && bit_is_set(*_ucsra, UDRE0)) {
*_udr = c;
sbi(*_ucsra, TXC0);
return 1;
}
tx_buffer_index_t i = (_tx_buffer_head + 1) % SERIAL_TX_BUFFER_SIZE;// If the output buffer is full, there's nothing for it other than to
// wait for the interrupt handler to empty it a bit
while (i == _tx_buffer_tail) {
if (bit_is_clear(SREG, SREG_I)) {
// Interrupts are disabled, so we'll have to poll the data
// register empty flag ourselves. If it is set, pretend an
// interrupt has happened and call the handler to free up
// space for us.
if(bit_is_set(*_ucsra, UDRE0))
_tx_udr_empty_irq();
} else {
// nop, the interrupt handler will free up space for us
}
}_tx_buffer[_tx_buffer_head] = c;
_tx_buffer_head = i;sbi(*_ucsrb, UDRIE0);
return 1;
}Nem gondolom, hogy az Arduinot használók között túl sokan vannak, akik az assembly kódot akarják bogarászni. Aki mégis, az meg azt is tudja, hogyan kell a fordítót paraméterezni, hogy legyen egy közbülső assembly kódod is.
Új hozzászólás Aktív témák
- HP EliteBook 840G6 ! AKCIÓ!!! a készlet erejéig!
- Kobo Aura Edition 2 (N236) 6" háttérvilágításos kijelzővel, 4 GB-os tárhellyel - jó állapotban
- HP ProBook 430 G8, 13,3" FHD IPS, I5-1135GU CPU, 16GB DDR4, 256GB SSD, WIN 11, 27% áfás számla, 1 év
- Playstation Portal - 3 hónap Bolti Garanciával
- BESZÁMÍTÁS! ÚJ AMD Ryzen 5600X 5700X 5800X 5900X processzor 3 év garancia 27% áfa termékbeszámítás
- LG 45GR95QE - 45" Ívelt OLED / 2K WQHD / 240Hz 0.03ms / NVIDIA G-Sync / FreeSync Premium / HDMI 2.1
- Bomba ár! Dell Latitude E7440 - i5-4GEN I 8GB I 500GB I 14" HD I HDMI I Cam I W10 I Gari!
- AKCIÓ! AMD Ryzen 9 7950X 16 mag 32 szál processzor garanciával hibátlan működéssel
- AKCIÓ! Lenovo Legion Slim 5 16AHP9 notebook - R7 8845HS 16GB RAM 512GB SSD RTX 4060 8GB Win11
- VÉGKIÁRUSÍTÁS - REFURBISHED - Lenovo ThinkPad 40AC Thunderbolt 3 docking station
Állásajánlatok
Cég: Promenade Publishing House Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest