susptest.4th 892 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. \ test suspend current
  2. : test-suspend-sequence ( -- flag )
  3. lcd-cls
  4. button-flush
  5. ctp-flush
  6. key-flush
  7. s" SUSPEND CURRENT MEASUREMENT" lcd-type
  8. lcd-cr lcd-cr
  9. s" 1. Do NOT touch screen" lcd-type lcd-cr
  10. s" 2. Do NOT press keys" lcd-type lcd-cr
  11. s" 3. Please wait while" lcd-type lcd-cr
  12. s" current is measured" lcd-type lcd-cr
  13. 10000 delay-us
  14. button-flush
  15. ctp-flush
  16. key-flush
  17. ." *SUSPEND*" cr
  18. key \ external process will send Y or N
  19. [char] Y = \ return true if Y received
  20. ." *RESUME*" cr
  21. button-flush
  22. ctp-flush
  23. key-flush
  24. ;
  25. : test-suspend-main ( -- )
  26. lcd-cls
  27. cr
  28. test-suspend-sequence if
  29. s" PASS"
  30. else
  31. s" FAIL"
  32. then
  33. lcd-cls
  34. lcd-text-columns 2/ lcd-text-rows 2/ lcd-at-xy
  35. 2dup lcd-type
  36. 500000 delay-us
  37. type ." : suspend test" cr
  38. ;