Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor js interpreter #750

Draft
wants to merge 60 commits into
base: main
Choose a base branch
from
Draft

Conversation

Tawank
Copy link
Contributor

@Tawank Tawank commented Jan 29, 2025

You can follow progress here

Proposed Changes

  • Added require() function with modules: audio, badusb, dialog, display, device/flipper, gpio, http, ir, keyboard/input, math, notification, serial, storage, subghz, submenu, widget and wifi
  • Added functions: ,
    • global: parse_int(), to_string(), to_hex_string(), to_lower_case() and to_upper_case()
    • gpio: gpio.dacWrite()
    • dialog: dialog.createTextViewer(), dialog.viewText()
    • display:
      • text: display.textAlign(), dialog.viewText()
      • rect: display.drawRoundRect(), display.drawFillRectGradient(), display.drawRoundRect(), display.drawFillRoundRect()
      • circle: display.drawCircle(), display.drawFillCircle()
      • bitmap: display.drawXBitmap(), display.drawBitmap()
      • sprites: display.createSprite()
  • Added global consts: __filepath, __dirpath and BRUCE_VERSION
  • Fixed some bugs with Bruce API

Types of Changes

Bugfix, New Feature

Verification

User-Facing Change

- Added `require()` function with modules: `audio`, `badusb`, `dialog`, `display`, `device`/`flipper`, `gpio`, `http`, `ir`, `keyboard`/`input`, `math`, `notification`, `serial`, `storage`, `subghz`, `submenu`, `widget` and `wifi`
- Added functions: , 
  - global: `parse_int()`, `to_string()`, `to_hex_string()`, `to_lower_case()` and `to_upper_case()`
  - gpio: `gpio.dacWrite()`
  - dialog: `dialog.createTextViewer()`, `dialog.viewText()`
  - display: 
    - text: `display.textAlign()`, `dialog.viewText()`
    - rect: `display.drawRoundRect()`, `display.drawFillRectGradient()`, `display.drawRoundRect()`, display.drawFillRoundRect()
    - circle: `display.drawCircle()`, `display.drawFillCircle()`
    - bitmap: `display.drawXBitmap()`, `display.drawBitmap()`
    - sprites: `display.createSprite()`
- Added global consts: `__filepath`, `__dirpath` and `BRUCE_VERSION`
- Fixed some bugs with Bruce API

Further Comments

@Tawank Tawank force-pushed the js_refractor_require branch from 65dfa72 to 35443d6 Compare January 29, 2025 18:42
@Tawank Tawank changed the title Add require function to js interpreter Refactor js interpreter to be compatible with flipper zero js Jan 29, 2025
Tawank added 25 commits January 30, 2025 00:42
@Tawank Tawank changed the title Refactor js interpreter to be compatible with flipper zero js Refactor js interpreter Mar 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants