You are reading a single comment by @user156811 and its replies. Click here to read the full conversation.
  • So i haven't fully tested this, but this is the intended way i was going to get around the idea of somebody trying to draw something when the pin is busy.

    This will only stop one draw that was added too quickly. Since its still using the same image buffer. But its primarily there just so it doesn't crash the board.

    SSD16xx.prototype.flip = function() {
        if(this.unInit == true){
          return this.init().then(()=>{
            return this.flip();
          });
        }
       if(this.busyPin.read()){
          return new Promise((resolve)=>{
              setWatch(resolve, this.busyPin, { repeat:false, edge:'falling' });
          }).then(()=>{
             return this.flip();
          });
       }
    
        this.scd(0x4E, 0);
        this.scd(0x4F, [0,0]);
        if(this.partialTran == true){
          this.partialTran = false;
          this.scd(0x26, this.g.bw.buffer);
          this.scd(0x24, this.g.bw.buffer);
        }
        else{
          this.scd(0x24, this.g.bw.buffer);
        }
    
    
        if(this.display.coloredDisplay){
            this.scd(0x4E, 0);
            this.scd(0x4F, [0,0]);
            this.scd(0x26, this.g.cw.buffer);
        }
    
        return this.refreshDisplay();
    };
    
About

Avatar for user156811 @user156811 started