Skip to content

added hook for error processing#156

Merged
fdesbiens merged 1 commit into
eclipse-threadx:devfrom
parsley:add_hook
Jun 1, 2026
Merged

added hook for error processing#156
fdesbiens merged 1 commit into
eclipse-threadx:devfrom
parsley:add_hook

Conversation

@parsley

@parsley parsley commented May 29, 2026

Copy link
Copy Markdown
Contributor

This is related to #148 (comment).

If GX_DISABLE_THREADX_BINDING is defined this gives the option to also define GX_ENABLE_ERROR_CALLBACK to activate another function call for custom RTOS bindings: VOID gx_generic_error_process(UINT error_code, ULONG error_count);

As mentioned in the linked issue-comment this hook could be used to call something like vTaskCustomSuspend(guix_task_handle); on a FreeRTOS system to keep GUIX from potentially breaking the whole FreeRTOS system by suspending the GUIX task.

Feel free to change this code before merging e.g. if you prefer to have this option independently of GX_DISABLE_THREADX_BINDING or if my proposal messes up some GUIX principle that I was not aware of.
I'd just like to have something in the GUIX library to immediately suspend the GUIX task at this point.

fdesbiens added a commit to fdesbiens/guix-fd that referenced this pull request Jun 1, 2026
All callers of _gx_canvas_drawing_initiate() must check the return
value before calling draw functions or _gx_canvas_drawing_complete().
When GX_DRAW_NESTING_EXCEEDED is returned the context stack is NOT
pushed, so calling _gx_canvas_drawing_complete() corrupts the outer
context's nesting counter.

Fix pattern (matching _gx_widget_children_draw.c reference impl):
  status = _gx_canvas_drawing_initiate(...);
  if (status == GX_SUCCESS) { draw(); _gx_canvas_drawing_complete(); }
  else if (status == GX_NO_VIEWS) { _gx_canvas_drawing_complete(); }
  // else: stack overflow or invalid memory -- do nothing

Files fixed:
- gx_animation_start.c
- gx_animation_drag_tracking_start.c
- gx_multi_line_text_view_text_draw.c
- gx_multi_line_text_input_draw.c
- gx_rich_text_view_text_draw.c
- gx_single_line_text_input_draw.c
- gx_radial_progress_bar_background_draw.c (GX_BRUSH_ALPHA_SUPPORT path)
- gx_widget_block_move.c
- gx_system_canvas_refresh.c (partial and non-partial paths)

Also applied PR eclipse-threadx#156: added GX_ENABLE_ERROR_CALLBACK hook for non-ThreadX
RTOS bindings, allowing callers to suspend the GUIX task on error.
- gx_system_error_process.c
- gx_system_rtos_bind.h

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@fdesbiens

Copy link
Copy Markdown
Contributor

Thank you for this contribution, @parsley. This is a useful addition. I am merging this as is and then will push a fix for issue #148.

@fdesbiens fdesbiens merged commit 90df3a2 into eclipse-threadx:dev Jun 1, 2026
1 check passed
fdesbiens added a commit to fdesbiens/guix-fd that referenced this pull request Jun 1, 2026
All callers of _gx_canvas_drawing_initiate() must check the return
value before calling draw functions or _gx_canvas_drawing_complete().
When GX_DRAW_NESTING_EXCEEDED is returned the context stack is NOT
pushed, so calling _gx_canvas_drawing_complete() corrupts the outer
context's nesting counter.

Fix pattern (matching _gx_widget_children_draw.c reference impl):
  status = _gx_canvas_drawing_initiate(...);
  if (status == GX_SUCCESS) { draw(); _gx_canvas_drawing_complete(); }
  else if (status == GX_NO_VIEWS) { _gx_canvas_drawing_complete(); }
  // else: stack overflow or invalid memory -- do nothing

Files fixed:
- gx_animation_start.c
- gx_animation_drag_tracking_start.c
- gx_multi_line_text_view_text_draw.c
- gx_multi_line_text_input_draw.c
- gx_rich_text_view_text_draw.c
- gx_single_line_text_input_draw.c
- gx_radial_progress_bar_background_draw.c (GX_BRUSH_ALPHA_SUPPORT path)
- gx_widget_block_move.c
- gx_system_canvas_refresh.c (partial and non-partial paths)
- gx_system_error_process.c (Copilot attribution only; functional changes via eclipse-threadx#156)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@parsley parsley deleted the add_hook branch June 3, 2026 09:53
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