Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
nexboot
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
nexboot
Commits
388ad1ac
Commit
388ad1ac
authored
May 24, 2018
by
Franco (nextime) Lanza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bootloader works. Now the hard work start...
parent
3584165e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
nexboot.c
main/nexboot.c
+3
-2
No files found.
main/nexboot.c
View file @
388ad1ac
...
@@ -207,13 +207,14 @@ static void mg_ev_handler(struct mg_connection *nc, int ev, void *p) {
...
@@ -207,13 +207,14 @@ static void mg_ev_handler(struct mg_connection *nc, int ev, void *p) {
case
MG_EV_HTTP_PART_DATA
:
{
case
MG_EV_HTTP_PART_DATA
:
{
data
->
bytes_written
+=
mp
->
data
.
len
;
data
->
bytes_written
+=
mp
->
data
.
len
;
ESP_LOG
I
(
TAG
,
"MG_EV_HTTP_PART_DATA %p len %d
\n
"
,
nc
,
mp
->
data
.
len
);
ESP_LOG
D
(
TAG
,
"MG_EV_HTTP_PART_DATA %p len %d
\n
"
,
nc
,
mp
->
data
.
len
);
ESP_ERROR_CHECK
(
esp_ota_write
(
data
->
update_handle
,
(
void
*
)
mp
->
data
.
p
,
mp
->
data
.
len
));
ESP_ERROR_CHECK
(
esp_ota_write
(
data
->
update_handle
,
(
void
*
)
mp
->
data
.
p
,
mp
->
data
.
len
));
break
;
break
;
}
}
case
MG_EV_HTTP_PART_END
:
{
case
MG_EV_HTTP_PART_END
:
{
ESP_LOGI
(
TAG
,
"Upload done, filesize: %d
\n
"
,
mp
->
data
.
len
);
mg_printf
(
nc
,
mg_printf
(
nc
,
"HTTP/1.1 200 OK
\r\n
"
"HTTP/1.1 200 OK
\r\n
"
"Content-Type: text/plain
\r\n
"
"Content-Type: text/plain
\r\n
"
...
@@ -221,10 +222,10 @@ static void mg_ev_handler(struct mg_connection *nc, int ev, void *p) {
...
@@ -221,10 +222,10 @@ static void mg_ev_handler(struct mg_connection *nc, int ev, void *p) {
"Written POST data to OTA partition
\n\n
"
);
"Written POST data to OTA partition
\n\n
"
);
nc
->
flags
|=
MG_F_SEND_AND_CLOSE
;
nc
->
flags
|=
MG_F_SEND_AND_CLOSE
;
free
(
data
);
nc
->
user_data
=
NULL
;
nc
->
user_data
=
NULL
;
ESP_ERROR_CHECK
(
esp_ota_end
(
data
->
update_handle
));
ESP_ERROR_CHECK
(
esp_ota_end
(
data
->
update_handle
));
ESP_ERROR_CHECK
(
esp_ota_set_boot_partition
(
data
->
update_partition
));
ESP_ERROR_CHECK
(
esp_ota_set_boot_partition
(
data
->
update_partition
));
free
(
data
);
ESP_LOGI
(
TAG
,
"Booting update... "
);
ESP_LOGI
(
TAG
,
"Booting update... "
);
esp_restart
();
esp_restart
();
break
;
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment