|  | @@ -15,7 +15,7 @@ extern abc800::keyboard abc800_keyboard;
 | 
	
		
			
				|  |  |  extern TimerHandle_t abc800_repeat_delay_timer;
 | 
	
		
			
				|  |  |  extern TimerHandle_t abc800_repeat_timer;
 | 
	
		
			
				|  |  |  extern TimerHandle_t abc800_check_timer;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +extern SoftwareSerial abc800_serial_keyboard;
 | 
	
		
			
				|  |  |  void  onRepeatTimer_abc800_in(TimerHandle_t xTimer) {
 | 
	
		
			
				|  |  |    abc800_keyboard.repeat_abc800_key();
 | 
	
		
			
				|  |  |    xTimerStart(abc800_repeat_timer, portMAX_DELAY);
 | 
	
	
		
			
				|  | @@ -42,8 +42,6 @@ namespace abc800
 | 
	
		
			
				|  |  |                      abc800_gpio.sendkey(abc800_keyboard.getABC800Keycode(key)); 
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |                  vTaskDelay((key.ascii == 0x13 ? 100 : 4) / portTICK_PERIOD_MS);
 | 
	
		
			
				|  |  | -            }else{
 | 
	
		
			
				|  |  | -                vTaskDelay(1 / portTICK_PERIOD_MS);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      }
 | 
	
	
		
			
				|  | @@ -57,36 +55,58 @@ namespace abc800
 | 
	
		
			
				|  |  |              uint32_t keyboard_action = 0;
 | 
	
		
			
				|  |  |              if (xTaskNotifyWait(0, ULONG_MAX, &keyboard_action , 5)  == pdPASS) {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                if (keyboard_action == ABC800_KEY_IN_ABC800)
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                if (keyboard_action == ABC800_KEY_RESET)
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    ESP_LOGI(TAG,"RESET");
 | 
	
		
			
				|  |  | +                    digitalWrite(A800_RST,LOW);
 | 
	
		
			
				|  |  | +                    delay(200);
 | 
	
		
			
				|  |  | +                    digitalWrite(A800_RST,HIGH);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                if (keyboard_action == ABC800_KEY_KD)
 | 
	
		
			
				|  |  |                  {
 | 
	
		
			
				|  |  | +                    ESP_LOGI(TAG,"KD INT");
 | 
	
		
			
				|  |  | +                    xTimerStop(abc800_repeat_delay_timer, portMAX_DELAY);
 | 
	
		
			
				|  |  | +                    xTimerStop(abc800_repeat_timer, portMAX_DELAY);
 | 
	
		
			
				|  |  | +                    xTimerStop(abc800_check_timer, portMAX_DELAY);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            } 
 | 
	
		
			
				|  |  | +            if (Serial1.available())
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                int code = Serial1.read();
 | 
	
		
			
				|  |  | +                ESP_LOGI(TAG,"BACK from computer %i",code);
 | 
	
		
			
				|  |  | +                abc800_serial_keyboard.write(code);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +                if (abc800_serial_keyboard.available() > 0)
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    ESP_LOGI(TAG,"KEY IN");
 | 
	
		
			
				|  |  |                      if (abc800_gpio.abc800_getupdown()){
 | 
	
		
			
				|  |  | -                        uint8_t key = abc800_gpio.abc800_getkey();
 | 
	
		
			
				|  |  | +                        uint8_t key = abc800_serial_keyboard.read();
 | 
	
		
			
				|  |  |                          key800queue ascii = abc800_keyboard.getKeyboardKeycode(key);
 | 
	
		
			
				|  |  |                          abc800_keyboard.abc800_old_key = key;
 | 
	
		
			
				|  |  |                          if (xQueueSend(abc800_key_queue_out, (void *)&ascii, 0) != pdTRUE) {
 | 
	
		
			
				|  |  |                              ESP_LOGE(TAG,"Queue full");
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  | +                        /*
 | 
	
		
			
				|  |  |                          xTimerStop(abc800_repeat_delay_timer, portMAX_DELAY);
 | 
	
		
			
				|  |  |                          xTimerStop(abc800_repeat_timer, portMAX_DELAY);
 | 
	
		
			
				|  |  |                          xTimerStop(abc800_check_timer, portMAX_DELAY);
 | 
	
		
			
				|  |  |                          xTimerStart(abc800_repeat_delay_timer, portMAX_DELAY);
 | 
	
		
			
				|  |  |                          xTimerStart(abc800_check_timer, portMAX_DELAY);
 | 
	
		
			
				|  |  | +                        */
 | 
	
		
			
				|  |  |                      }else{
 | 
	
		
			
				|  |  | +                        /*
 | 
	
		
			
				|  |  |                          xTimerStop(abc800_repeat_delay_timer, portMAX_DELAY);
 | 
	
		
			
				|  |  |                          xTimerStop(abc800_repeat_timer, portMAX_DELAY);
 | 
	
		
			
				|  |  |                          xTimerStop(abc800_check_timer, portMAX_DELAY);
 | 
	
		
			
				|  |  | +                        */
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -                if (keyboard_action == ABC800_KEY_RESET)
 | 
	
		
			
				|  |  | -                {
 | 
	
		
			
				|  |  | -                    ESP_LOGI(TAG,"RESET");
 | 
	
		
			
				|  |  | -                    digitalWrite(A800_RST,LOW);
 | 
	
		
			
				|  |  | -                    delay(200);
 | 
	
		
			
				|  |  | -                    digitalWrite(A800_RST,HIGH);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -            }       
 | 
	
		
			
				|  |  | +                } 
 | 
	
		
			
				|  |  | +            vTaskDelay(1 / portTICK_PERIOD_MS);    
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |      
 | 
	
	
		
			
				|  | @@ -226,6 +246,7 @@ namespace abc800
 | 
	
		
			
				|  |  |              outkey.modifier =0x00;
 | 
	
		
			
				|  |  |              outkey.special = 0x00;
 | 
	
		
			
				|  |  |              outkey.ascii = abc800key;
 | 
	
		
			
				|  |  | +            ESP_LOGI(TAG,"KEY %d",abc800key);
 | 
	
		
			
				|  |  |              if (abc800key >=0x61 && abc800key <=0x7a){ // small letter
 | 
	
		
			
				|  |  |                  return (outkey);
 | 
	
		
			
				|  |  |              }
 | 
	
	
		
			
				|  | @@ -241,6 +262,7 @@ namespace abc800
 | 
	
		
			
				|  |  |                      abc800key != 0x27){ // Digits symbols
 | 
	
		
			
				|  |  |                  return (outkey);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | +            
 | 
	
		
			
				|  |  |              switch(abc800key){
 | 
	
		
			
				|  |  |     
 | 
	
		
			
				|  |  |                  case 0x2b:		// +
 |