WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit ed26218

Browse files
committed
Make it compile with AtomVM main branch
globalcontext_insert_atom is not available in AtomVM main branch. Signed-off-by: Davide Bettio <[email protected]>
1 parent ac0e09c commit ed26218

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

display_common.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
bool display_common_gpio_from_opts(
2626
term opts, const char *atom_str, int *gpio_num, GlobalContext *global)
2727
{
28-
int atom_index = globalcontext_insert_atom(global, atom_str);
29-
term gpio_atom = term_from_atom_index(atom_index);
28+
term gpio_atom = globalcontext_make_atom(global, atom_str);
3029

3130
term gpio_term = interop_proplist_get_value(opts, gpio_atom);
3231
if (gpio_term == term_nil()) {

display_driver.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ Context *st7789_display_create_port(GlobalContext *global, term opts);
3737

3838
Context *display_create_port(GlobalContext *global, term opts)
3939
{
40-
int compat_atom_index = globalcontext_insert_atom(global, ATOM_STR("\xA", "compatible"));
41-
term compat_atom = term_from_atom_index(compat_atom_index);
40+
term compat_atom = globalcontext_make_atom(global, ATOM_STR("\xA", "compatible"));
4241

4342
term compat_value_term = interop_proplist_get_value(opts, compat_atom);
4443
if (compat_value_term == term_nil()) {

spi_display.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ bool spi_display_parse_config(struct SPIDisplayConfig *spi_config, term opts, Gl
8484
return false;
8585
}
8686

87-
int spi_host_atom_index = globalcontext_insert_atom(global, ATOM_STR("\x8", "spi_host"));
88-
term spi_host_atom = term_from_atom_index(spi_host_atom_index);
87+
term spi_host_atom = globalcontext_make_atom(global, ATOM_STR("\x8", "spi_host"));
8988
term spi_port = interop_proplist_get_value(opts, spi_host_atom);
9089

9190
ok = spi_driver_get_peripheral(spi_port, &spi_config->host_dev, global);

0 commit comments

Comments
 (0)