Skip to content

Commit

Permalink
microbit: Add scissors icon to microbit.Image.
Browse files Browse the repository at this point in the history
Fixes issue #602.
  • Loading branch information
microbit-sam authored and dpgeorge committed Sep 6, 2021
1 parent f524840 commit 5005880
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/image.rst
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ represents):
* ``Image.SKULL``
* ``Image.UMBRELLA``
* ``Image.SNAKE``
* ``Image.SCISSORS``

Finally, related collections of images have been grouped together::

Expand Down
1 change: 1 addition & 0 deletions docs/tutorials/images.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Here's a list of the built-in images:
* ``Image.SKULL``
* ``Image.UMBRELLA``
* ``Image.SNAKE``
* ``Image.SCISSORS``

There's quite a lot! Why not modify the code that makes the micro:bit look
happy to see what some of the other built-in images look like? (Just replace
Expand Down
1 change: 1 addition & 0 deletions inc/genhdr/qstrdefs.generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ QDEF(MP_QSTR_GIRAFFE, (const byte*)"\x7d\x07" "GIRAFFE")
QDEF(MP_QSTR_SKULL, (const byte*)"\x48\x05" "SKULL")
QDEF(MP_QSTR_UMBRELLA, (const byte*)"\xc9\x08" "UMBRELLA")
QDEF(MP_QSTR_SNAKE, (const byte*)"\x97\x05" "SNAKE")
QDEF(MP_QSTR_SCISSORS, (const byte*)"\xf2\x08" "SCISSORS")
QDEF(MP_QSTR_ALL_ARROWS, (const byte*)"\xf1\x0a" "ALL_ARROWS")
QDEF(MP_QSTR_ALL_CLOCKS, (const byte*)"\xc0\x0a" "ALL_CLOCKS")
QDEF(MP_QSTR_MicroBitDisplay, (const byte*)"\x5a\x0f" "MicroBitDisplay")
Expand Down
1 change: 1 addition & 0 deletions inc/microbit/modmicrobit.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ extern const struct _monochrome_5by5_t microbit_const_image_giraffe_obj;
extern const struct _monochrome_5by5_t microbit_const_image_skull_obj;
extern const struct _monochrome_5by5_t microbit_const_image_umbrella_obj;
extern const struct _monochrome_5by5_t microbit_const_image_snake_obj;
extern const struct _monochrome_5by5_t microbit_const_image_scissors_obj;

/****************************************************************/
// microbit.display object
Expand Down
1 change: 1 addition & 0 deletions inc/microbit/qstrdefsport.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ Q(GIRAFFE)
Q(SKULL)
Q(UMBRELLA)
Q(SNAKE)
Q(SCISSORS)

Q(ALL_ARROWS)
Q(ALL_CLOCKS)
Expand Down
8 changes: 8 additions & 0 deletions source/microbit/microbitconstimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,4 +556,12 @@ IMAGE_T microbit_const_image_snake_obj = SMALL_IMAGE(
0,0,0,0,0
);

IMAGE_T microbit_const_image_scissors_obj = SMALL_IMAGE(
1,1,0,0,1,
1,1,0,1,0,
0,0,1,0,0,
1,1,0,1,0,
1,1,0,0,1
);

}
1 change: 1 addition & 0 deletions source/microbit/microbitimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,7 @@ STATIC const mp_map_elem_t microbit_image_locals_dict_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_SKULL), (mp_obj_t)&microbit_const_image_skull_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_UMBRELLA), (mp_obj_t)&microbit_const_image_umbrella_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SNAKE), (mp_obj_t)&microbit_const_image_snake_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SCISSORS), (mp_obj_t)&microbit_const_image_scissors_obj },
};

STATIC MP_DEFINE_CONST_DICT(microbit_image_locals_dict, microbit_image_locals_dict_table);
Expand Down

0 comments on commit 5005880

Please sign in to comment.