serial.4th 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. \ serial.4th
  2. base @ decimal
  3. : display-serial-number ( -- )
  4. lcd-black
  5. lcd-cls
  6. s" Read Serial Number from FLASH" lcd-type
  7. 24 lcd-text-rows 1- lcd-at-xy
  8. s" Exit" lcd-type
  9. 0 2 lcd-at-xy
  10. here flash-serial-number-length flash-serial-number-offset flash-read
  11. if
  12. s" Serial Number:" lcd-type lcd-cr
  13. flash-serial-number-length 0
  14. ?do
  15. here i + c@
  16. dup bl 127 within
  17. if
  18. lcd-emit
  19. else
  20. drop
  21. then
  22. loop
  23. else
  24. s" Error: No Serial Number Found" lcd-type
  25. then
  26. button-flush
  27. key-flush
  28. ctp-flush
  29. begin
  30. ctp-pos? if
  31. ctp-flush
  32. then
  33. button? if
  34. button
  35. case
  36. button-left of
  37. endof
  38. button-centre of
  39. endof
  40. button-right of
  41. exit
  42. endof
  43. endcase
  44. then
  45. key? if
  46. key-flush
  47. then
  48. wait-for-event
  49. again
  50. ;
  51. base !