Search is not available for this dataset
sample_type stringclasses 3
values | node_type stringclasses 6
values | file_path stringlengths 13 93 | prefix stringlengths 0 4.1k | suffix stringlengths 0 4.1k | middle stringlengths 1 1.6k | text stringlengths 131 8.36k |
|---|---|---|---|---|---|---|
masked_node | if_statement | src/fw/util/mbuf_iterator.c | /*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... |
uint8_t *buffer = mbuf_get_data(iter->m);
*data = buffer[iter->data_index++];
return true;
}
bool mbuf_iterator_write_byte(MBufIterator *iter, uint8_t data) {
if (mbuf_iterator_is_finished(iter)) {
return false;
}
uint8_t *buffer = mbuf_get_data(iter->m);
buffer[iter->data_index++] = data;
return ... | if (mbuf_iterator_is_finished(iter)) {
return false;
} | <|repo_name|>pebble
<|file_sep|>src/fw/util/mbuf_iterator.c
<|fim_prefix|>/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/l... |
masked_node | compound_statement | src/fw/process_management/app_menu_data_source.c | kLaunch);
const int override_cmp_rv = prv_app_override_comparator(app_node->install_id,
new_node->install_id);
if (is_app_quick_launch != is_new_quick_launch) {
// Quick Launch only apps are first
return (is_app_quick_launch ? 1 : 0) - (is_new_quick_... |
kernel_free(install_data);
}
void prv_send_callback_to_app(AppMenuDataSource *data_source, AppInstallId install_id,
InstallEventType event_type) {
InstallData *install_data = kernel_malloc_check(sizeof(InstallData));
*install_data = (InstallData) {
.id = install_id,
.sourc... | {
case APP_AVAILABLE:
prv_do_app_added(source, install_id);
break;
case APP_REMOVED:
prv_do_app_removed(source, install_id);
break;
case APP_ICON_NAME_UPDATED:
prv_do_app_icon_name_updated(source, install_id);
break;
case APP_DB_CLEARED:
prv_do_app_db_cleared(so... | <|repo_name|>pebble
<|file_sep|>src/fw/process_management/app_menu_data_source.c
<|fim_prefix|>kLaunch);
const int override_cmp_rv = prv_app_override_comparator(app_node->install_id,
new_node->install_id);
if (is_app_quick_launch != is_new_quick_launch) {
... |
masked_node | argument_list | tests/fw/comm/test_gatt_client_subscriptions.c | scover_all(&s_device), BTErrnoOK);
prv_simulate_and_assert_discovery_of_one_service(&s_device);
fake_event_clear_last();
}
void test_gatt_client_subscriptions__cleanup(void) {
for (GAPLEClient c = 0; c < GAPLEClientNum; ++c) {
gatt_client_subscriptions_cleanup_by_client(c);
}
gap_le_connection_deinit();... | ;
cl_assert_equal_i(e, BTErrnoOK);
fake_event_clear_last();
fake_kernel_malloc_mark();
// Un-subscribe, while subscribing process is still pending:
e = gatt_client_subscriptions_subscribe(characteristic, BLESubscriptionNone, GAPLEClientKernel);
cl_assert_equal_i(e, BTErrnoInvalidState);
fake_kernel_mallo... | (characteristic, BLESubscriptionIndications,
GAPLEClientKernel) | <|repo_name|>pebble
<|file_sep|>tests/fw/comm/test_gatt_client_subscriptions.c
<|fim_prefix|>scover_all(&s_device), BTErrnoOK);
prv_simulate_and_assert_discovery_of_one_service(&s_device);
fake_event_clear_last();
}
void test_gatt_client_subscriptions__cleanup(void) {
for (GAPLEClient c = 0; c < GAPLEClientNum;... |
masked_node | call_expression | src/fw/kernel/util/factory_reset.c | /*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | ;
prv_factory_reset_non_pfs_data();
pfs_remove_files(NULL);
prv_factory_reset_post(false /* should_shutdown */);
}
#endif // !RECOVERY_FW
//! Used by the mfg flow to kick us out the MFG firmware and into the conumer PRF that's stored
//! on the external flash.
void command_enter_consumer_mode(void) {
boot_b... | close_db_files() | <|repo_name|>pebble
<|file_sep|>src/fw/kernel/util/factory_reset.c
<|fim_prefix|>/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apach... |
masked_node | call_expression | src/fw/services/normal/activity/health_util.c | 0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the Lic... | ;
snprintf((char *) hours_text_node->text, hours_and_minutes_buffer_size,
i18n_get("%d", i18n_owner), hours);
GTextNodeText *hours_units_text_node = health_util_create_text_node_with_text(
i18n_get("H", i18n_owner), units_font, color, container);
hours_units_text_node->node.offset.y = ... | health_util_create_text_node(hours_and_minutes_buffer_size,
number_font, color, container) | <|repo_name|>pebble
<|file_sep|>src/fw/services/normal/activity/health_util.c
<|fim_prefix|>0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See ... |
masked_node | call_expression | src/fw/services/normal/comm_session/app_session_capabilities.c | /*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | ;
settings_file_close(&settings_file);
}
}
void comm_session_app_session_capabilities_init(void) {
SettingsFile settings_file;
if (PASSED(prv_open(&settings_file))) {
settings_file_rewrite(&settings_file, prv_rewrite_cb, NULL);
settings_file_close(&settings_file);
}
}
| settings_file_delete(&settings_file, app_uuid, sizeof(*app_uuid)) | <|repo_name|>pebble
<|file_sep|>src/fw/services/normal/comm_session/app_session_capabilities.c
<|fim_prefix|>/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License a... |
masked_node | compound_statement | tests/libc/printf/test_sprintf.c |
"aaaa aaaa aaaa aaaa " // 20- 40
"aaaa aaaa aaaa aaaa " // 40- 60
"aaaa aaaa aaaa aaaa " // 60- 80
"aaaa aaaa aaaa aaaa " // 80-100
"aaaa aaaa aaaa aaaa " //100-120
"aaaa aaaa... | cl_assert_equal_i(tntest[1], 0);
} | <|repo_name|>pebble
<|file_sep|>tests/libc/printf/test_sprintf.c
<|fim_prefix|>
"aaaa aaaa aaaa aaaa " // 20- 40
"aaaa aaaa aaaa aaaa " // 40- 60
"aaaa aaaa aaaa aaaa " // 60- 80
"aaaa aaaa aaaa aaaa " // 80-100
... | |
prefix_only | call_expression | tests/libutil/test_math.c | check_atan2(1, -32768); // <- causes overflow for int16
check_atan2(20001, 20000); // <- causes overflow if numbers are added in an int16
check_atan2(32767, 1);
check_atan2(1, 32767);
check_atan2(32767, 0);
check_atan2(0, 32767);
check_atan2(23400, -25300);
check_atan2(30500, -1930);
check_atan2(-6, -3... | WITHIN(5, min, max) | <|repo_name|>pebble
<|file_sep|>tests/libutil/test_math.c
<|fim_prefix|> check_atan2(1, -32768); // <- causes overflow for int16
check_atan2(20001, 20000); // <- causes overflow if numbers are added in an int16
check_atan2(32767, 1);
check_atan2(1, 32767);
check_atan2(32767, 0);
check_atan2(0, 32767);
check... | |
masked_node | argument_list | tests/fw/services/test_pfs.c | ce Avail = %d\n", bytes_available);
uint8_t *bigbuf = (uint8_t *)calloc(large_file_size, 1);
uint16_t curr = 0;
for (int i = 0; i < 2; i++) {
snprintf(file_large, sizeof(file_large), "large%d", i);
for (int i = 0; i < large_file_size / 4; i++) {
*(((uint32_t *)((uint8_t *)bigbuf)) + i) = curr | (cu... | ;
}
pfs_close(fd);
}
return (idx);
}
void test_pfs__out_of_space(void) {
pfs_format(false /* write erase headers */); // start with an empty flash
pfs_init(false);
int num_iters = 30;
for (int i = 0; i < num_iters; i++) {
int files_written = run_full_flash_region_test();
if ((i % 2) == 0... | (out_val, st_val) | <|repo_name|>pebble
<|file_sep|>tests/fw/services/test_pfs.c
<|fim_prefix|>ce Avail = %d\n", bytes_available);
uint8_t *bigbuf = (uint8_t *)calloc(large_file_size, 1);
uint16_t curr = 0;
for (int i = 0; i < 2; i++) {
snprintf(file_large, sizeof(file_large), "large%d", i);
for (int i = 0; i < large_file_s... |
masked_node | call_expression | src/fw/services/normal/activity/activity_insights.c | int32_t sleep_total_seconds,
ActivityScalarStore sleep_average_seconds, Uuid *uuid) {
prv_generate_sleep_pin_strings(sleep_enter_seconds, sleep_exit_seconds, sleep_total_seconds);
// Insert or update the pin
return prv_push_summary_pin(... | ;
kernel_free(start_time);
kernel_free(short_subtitle);
kernel_free(elapsed);
i18n_free_all(&pin_attr_list);
attribute_list_destroy_list(&pin_attr_list);
return item;
}
// ------------------------------------------------------------------------------------------------
// Creates a notification to notify t... | kernel_free(end_time) | <|repo_name|>pebble
<|file_sep|>src/fw/services/normal/activity/activity_insights.c
<|fim_prefix|> int32_t sleep_total_seconds,
ActivityScalarStore sleep_average_seconds, Uuid *uuid) {
prv_generate_sleep_pin_strings(sleep_enter_seconds, sleep... |
prefix_only | argument_list | src/fw/apps/core_apps/spinner_ui_window.c | f 1.
// This means that the the lag occurs once less frequently and is less noticable
#define LOOPS_PER_ANIMATION 10
#define LOOP_DURATION_MS 1500
static void prv_draw_spinner_circles(Layer *layer, GContext* ctx) {
// Drawing the circles with aa is just too slow and we end up backing up the rest of the system.
// ... | (RESOURCE_ID_SPINNER_BACKGROUND) | <|repo_name|>pebble
<|file_sep|>src/fw/apps/core_apps/spinner_ui_window.c
<|fim_prefix|>f 1.
// This means that the the lag occurs once less frequently and is less noticable
#define LOOPS_PER_ANIMATION 10
#define LOOP_DURATION_MS 1500
static void prv_draw_spinner_circles(Layer *layer, GContext* ctx) {
// Drawing the... | |
masked_node | compound_statement | src/fw/drivers/backlight.c | | | | | | | | |
// | | | | | | | |
// ------- ------- ------- --------
//
// The resulting waveform has a frequency of PWM_OUTPUT_FREQUENCY_HZ. Inside each period, the timer
// ... |
}
if (BOARD_CONFIG_BACKLIGHT.options & ActuatorOptions_IssiI2C) {
led_controller_backlight_set_brightness(brightness >> 8);
}
}
void command_backlight_ctl(const char *arg) {
const int bright_percent = atoi(arg);
if (bright_percent < 0 || bright_percent > 100) {
prompt_send_response("Invalid Brightn... | {
if (!s_backlight_pwm_enabled) {
prv_backlight_pwm_enable(true);
}
// By setting higher values in the TIM_Pulse register, we're causing the output waveform
// to be low for a longer period of time, which causes the backlight to be brighter.
//
// The brightness value has a ... | <|repo_name|>pebble
<|file_sep|>src/fw/drivers/backlight.c
<|fim_prefix|> | | | | | | | |
// | | | | | | | |
// ------- ------- ------- --------
//
// The resulting waveform has ... |
masked_node | compound_statement | tests/fw/ui/test_text_layer.c | /*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... |
void graphics_context_set_fill_color(GContext* ctx, GColor color){}
void graphics_context_set_text_color(GContext* ctx, GColor color){}
// Fakes
////////////////////////
#define MOCKED_CREATED_LAYOUT (GTextLayoutCacheRef)123456
void graphics_text_layout_cache_init(GTextLayoutCacheRef *layout_cache) {
*layout_cac... | {
return NULL;
} | <|repo_name|>pebble
<|file_sep|>tests/fw/ui/test_text_layer.c
<|fim_prefix|>/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org... |
masked_node | argument_list | src/fw/applib/ui/dialogs/bt_conn_dialog.c | /*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | ;
}
simple_dialog_push(&bt_dialog->dialog, window_stack);
}
BtConnDialog *bt_conn_dialog_create(void) {
BtConnDialog *bt_dialog = applib_malloc(sizeof(BtConnDialog));
bt_conn_dialog_init(bt_dialog, NULL, 0);
return bt_dialog;
}
void bt_conn_dialog_init(BtConnDialog *bt_dialog, char *text_buffer, size_t buff... | (ModalPriorityCritical) | <|repo_name|>pebble
<|file_sep|>src/fw/applib/ui/dialogs/bt_conn_dialog.c
<|fim_prefix|>/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://ww... |
masked_node | compound_statement | src/fw/apps/system_apps/alarms/alarm_editor.c | ////////////////////////////////////////////////////////////////////////////////
//! Day Picker
static void prv_day_picker_window_unload(Window *window) {
AlarmEditorData *data = (AlarmEditorData*) window_get_user_data(window);
if (!data->day_picker_was_completed && data->time_picker_was_completed) {
// If we... |
}
static void prv_setup_day_picker_window(AlarmEditorData *data) {
window_init(&data->day_picker_window, WINDOW_NAME("Alarm Day Picker"));
window_set_user_data(&data->day_picker_window, data);
data->day_picker_window.window_handlers.unload = prv_day_picker_window_unload;
GRect bounds = data->day_picker_windo... | {
data->day_picker_was_completed = true;
prv_handle_selection(cell_index->row, callback_context);
} | <|repo_name|>pebble
<|file_sep|>src/fw/apps/system_apps/alarms/alarm_editor.c
<|fim_prefix|>////////////////////////////////////////////////////////////////////////////////
//! Day Picker
static void prv_day_picker_window_unload(Window *window) {
AlarmEditorData *data = (AlarmEditorData*) window_get_user_data(window... |
masked_node | compound_statement | src/fw/services/normal/send_text_service.c | /*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... |
s_has_send_text_reply_action = prv_has_send_text_reply_action();
}
void send_text_service_init(void) {
// Save the initial state
s_has_send_text_reply_action = prv_has_send_text_reply_action();;
// Register for updates
static EventServiceInfo s_blobdb_event_info = {
.type = PEBBLE_BLOBDB_EVENT,
.h... | {
return;
} | <|repo_name|>pebble
<|file_sep|>src/fw/services/normal/send_text_service.c
<|fim_prefix|>/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://w... |
masked_node | call_expression | src/fw/apps/demo_apps/flash_prof.c | /*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | ;
}
static void handle_deinit(void) {
}
static void s_main(void) {
handle_init();
app_event_loop();
handle_deinit();
}
const PebbleProcessMd* flash_prof_get_app_info() {
static const PebbleProcessMdSystem s_app_info = {
.common.main_func = &s_main,
.name = "Flash Prof"
};
return (const PebblePr... | app_window_stack_push((Window *)&number_window, true) | <|repo_name|>pebble
<|file_sep|>src/fw/apps/demo_apps/flash_prof.c
<|fim_prefix|>/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apach... |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 7