Skip to content

Commit

Permalink
Code consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Smith committed Jul 26, 2024
1 parent 63527b2 commit f15c3f1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
10 changes: 5 additions & 5 deletions app/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ MvChannelHandle http_get_handle(void) {


/**
* @brief Configure the channel Notification Center.
* @brief Configure the channel notification center.
*/
void http_setup_notification_center(void) {

Expand All @@ -129,12 +129,12 @@ void http_setup_notification_center(void) {
// Ask Microvisor to establish the notification center
// and confirm that it has accepted the request
enum MvStatus status = mvSetupNotifications(&http_notification_setup, &http_handles.notification);
do_assert(status == MV_STATUS_OKAY, "Could not set up HTTP channel Notification Center");
do_assert(status == MV_STATUS_OKAY, "Could not set up HTTP channel notification center");

// Start the notification IRQ
NVIC_ClearPendingIRQ(TIM8_BRK_IRQn);
NVIC_EnableIRQ(TIM8_BRK_IRQn);
server_log("HTTP Notification Center handle: %lu", (uint32_t)http_handles.notification);
server_log("HTTP notification center handle: %lu", (uint32_t)http_handles.notification);
}


Expand All @@ -158,8 +158,8 @@ enum MvStatus http_send_request(uint32_t item_number) {
// Set up the request
const char verb[] = "GET";
const char body[] = "";
char url[46] = "";
sprintf(url, "https://jsonplaceholder.typicode.com/todos/%lu", item_number);
char url[64] = "";
snprintf(url, 64, "https://jsonplaceholder.typicode.com/todos/%lu", item_number);
const struct MvHttpHeader hdrs[] = {};
const struct MvHttpRequest request_config = {
.method = {
Expand Down
9 changes: 4 additions & 5 deletions app/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,7 @@ static void process_http_response(void) {
// the request was successful (status code 200)
if (resp_data.result == MV_HTTPRESULT_OK) {
if (resp_data.status_code == 200) {
server_log("HTTP response header count: %lu", resp_data.num_headers);
server_log("HTTP response body length: %lu", resp_data.body_length);
server_log("HTTP response received. Body length: %lu bytes, %lu headers", resp_data.body_length, resp_data.num_headers);

// Set up a buffer that we'll get Microvisor to write
// the response body into
Expand Down Expand Up @@ -335,7 +334,7 @@ static void output_headers(uint32_t num_headers) {


/**
* @brief Configure the System Notification Center.
* @brief Configure the System notification center.
*/
static void setup_sys_notification_center(void) {

Expand All @@ -353,7 +352,7 @@ static void setup_sys_notification_center(void) {
// and confirm that it has accepted the request
enum MvStatus status = mvSetupNotifications(&sys_notification_setup, &sys_nc_handle);
do_assert(status == MV_STATUS_OKAY, "Could not set up sys NC");
server_log("System Notification Center handle: %lu", (uint32_t)sys_nc_handle);
server_log("System notification center handle: %lu", (uint32_t)sys_nc_handle);

// Tell Microvisor to use the new notification center for system notifications
const struct MvOpenSystemNotificationParams sys_notification_params = {
Expand Down Expand Up @@ -411,7 +410,7 @@ static void do_clear_led(void* arg) {


/**
* @brief The System Notification Center interrupt handler.
* @brief The System notification center interrupt handler.
*
* This is called by Microvisor -- we need to check for key events
* such as polite deployment.
Expand Down
7 changes: 3 additions & 4 deletions app/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void net_open_network(void) {


/**
* @brief Configure the network Notification Center.
* @brief Configure the network notification center.
*/
static void net_setup_notification_center(void) {

Expand All @@ -93,12 +93,12 @@ static void net_setup_notification_center(void) {
// Ask Microvisor to establish the notification center
// and confirm that it has accepted the request
enum MvStatus status = mvSetupNotifications(&net_notification_config, &net_handles.notification);
do_assert(status == MV_STATUS_OKAY, "Could not start network Notification Center");
do_assert(status == MV_STATUS_OKAY, "Could not start network notification center");

// Start the notification IRQ
NVIC_ClearPendingIRQ(TIM2_IRQn);
NVIC_EnableIRQ(TIM2_IRQn);
server_log("Network Notification Center handle: %lu", (uint32_t)net_handles.notification);
server_log("Network notification center handle: %lu", (uint32_t)net_handles.notification);
}
}

Expand All @@ -123,4 +123,3 @@ void TIM2_IRQHandler(void) {
// Add your own notification processing code here
}


0 comments on commit f15c3f1

Please sign in to comment.