Happy little incident #10

Mcu32

Well-known member
Code:
    inline PORTBemulation & operator |= (int val) __attribute__((always_inline)) {
        if (val & (1<<0)) {
            digitalWriteFast(8, HIGH);
            if (!(CORE_PIN7_DDRREG & CORE_PIN7_BITMASK)) CORE_PIN8_CONFIG = CONFIG_PULLUP;
        }
        if (val & (1<<1)) {
            digitalWriteFast(9, HIGH);
            if (!(CORE_PIN7_DDRREG & CORE_PIN7_BITMASK)) CORE_PIN9_CONFIG = CONFIG_PULLUP;
        }

Also, check all the |= and &= ....
 
Okay, enough for now. Tell me, when you want the next 10 "real bugs"
I left out all race condition and bad code findings so far.
 
Back
Top