notes.txt 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. //+============================================================================ ========================================
  2. // Select font
  3. // A full list of u8g2 fonts can be found here:
  4. // https://github.com/olikraus/u8g2/wiki/fntlistall
  5. // ...and here are the ones available in FZ (currently: all of them):
  6. // grep -P '.*u8g2.*\[[0-9]*\]' lib/u8g2/u8g2_fonts.c | sed 's/.*\(u8g2_.*\)\[.*/\1/'
  7. //
  8. #if 0 //! Extra fonts is just too memory hungry
  9. #include <u8g2.h>
  10. void setFont (Canvas* const canvas, const uint8_t* font)
  11. {
  12. u8g2_SetFontMode(&canvas->fb, 1); // no idea - but canvas.c does it <shrug>
  13. u8g2_SetFont(&canvas->fb, font);
  14. }
  15. #endif
  16. litui : @BlueChip for posterity, the function to break at is flipper_application_spawn. At that point, you can set new breakpoints in your fap code and continue.
  17. /*
  18. This is wrong on quite a few levels!
  19. https://training.ti.com/introduction-i2c-reserved-addresses
  20. void doit (void)
  21. {
  22. furi_hal_i2c_acquire(&furi_hal_i2c_handle_external);
  23. printf("Scanning external i2c on PC0(SCL)/PC1(SDA)\r\n"
  24. "Clock: 100khz, 7bit address\r\n"
  25. "\r\n");
  26. printf(" | 0 1 2 3 4 5 6 7 8 9 A B C D E F\r\n");
  27. printf("--+--------------------------------\r\n");
  28. for(uint8_t row = 0; row < 0x8; row++) {
  29. printf("%x | ", row);
  30. for(uint8_t column = 0; column <= 0xF; column++) {
  31. bool ret = furi_hal_i2c_is_device_ready(
  32. &furi_hal_i2c_handle_external, ((row << 4) + column) << 1, 2);
  33. printf("%c ", ret ? '#' : '-');
  34. }
  35. printf("\r\n");
  36. }
  37. furi_hal_i2c_release(&furi_hal_i2c_handle_external);
  38. }
  39. */
  40. region locking : firmware/targets/f7/furi_hal/furi_hal_region.c
  41. # if 0 //! scrolling works beautifully, but the LCD refresh can't keep up :(
  42. // Waveform
  43. if (cnt) { // start
  44. for (int a = ACC_1; a < ACC_N; a++) {
  45. canvas_draw_dot(canvas, x,y[a]+v[a][idx]);
  46. for (int i = 1; i < aw -cnt; i++) {
  47. canvas_draw_line(canvas, x+i,y[a]+v[a][i-1] , x+i,y[a]+v[a][i]);
  48. }
  49. }
  50. } else { // scroll
  51. for (int a = ACC_1; a < ACC_N; a++) {
  52. for (int i = 0; i < aw; i++) {
  53. int off = (idx +i) %aw;
  54. int prev = off ? off-1 : aw-1;
  55. canvas_draw_line(canvas, x+i,y[a]+v[a][prev] , x+i,y[a]+v[a][off]);
  56. }
  57. }
  58. }
  59. # else
  60. int end = idx ? idx : aw;
  61. for (int a = ACC_1; a < ACC_N; a++) {
  62. canvas_draw_dot(canvas, x,y[a]+v[a][idx]);
  63. if (state->apause) {
  64. for (int i = 1; i < end; i++)
  65. canvas_draw_line(canvas, x+i,y[a]+v[a][i-1] , x+i,y[a]+v[a][i]);
  66. } else {
  67. for (int i = 1; i < end; i++)
  68. canvas_draw_line(canvas, x+i,y[a]+v[a][i-1] , x+i,y[a]+v[a][i]);
  69. for (int i = end+10; i < aw -cnt; i++)
  70. canvas_draw_line(canvas, x+i,y[a]+v[a][i-1] , x+i,y[a]+v[a][i]);
  71. }
  72. }
  73. // Wipe bar
  74. if (end < aw) canvas_draw_line(canvas, x+end,y[0], x+end,y[2]+ah-1);
  75. if (++end < aw) canvas_draw_line(canvas, x+end,y[0], x+end,y[2]+ah-1);
  76. if (++end < aw) canvas_draw_line(canvas, x+end,y[0], x+end,y[2]+ah-1);
  77. # endif