blinkenstrip

Documentation: http://frombelow.net/projects/blinkenstrip/
Clone: git clone https://git.frombelow.net/blinkenstrip.git
Log | Files | Refs | README | LICENSE

main.h (1506B)


      1 /*
      2   Copyright © 2021 Gerd Beuster <gerd@frombelow.net>
      3 
      4   Licensed under the Apache License, Version 2.0 (the "License");
      5   you may not use this file except in compliance with the License.
      6   You may obtain a copy of the License at
      7 
      8       http://www.apache.org/licenses/LICENSE-2.0
      9 
     10   Unless required by applicable law or agreed to in writing, software
     11   distributed under the License is distributed on an "AS IS" BASIS,
     12   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13   See the License for the specific language governing permissions and
     14   limitations under the License.
     15 */
     16 #ifndef MAIN_H
     17 #define MAIN_H
     18 
     19 #include "webserver.h"
     20 
     21 char *app_name;
     22 // WIFI configuration
     23 uint8_t wifi_ap;
     24 char *wifi_essid;
     25 char *wifi_password;
     26 
     27 /* Register page handlers */
     28 static void handler_index_html(struct netconn *conn, char *base_url_begin,
     29                                char *base_url_end, char *parameters);
     30 static void handler_config_html(struct netconn *conn, char *base_url_begin,
     31                                 char *base_url_end, char *parameters);
     32 // These constants are used in webserver.c to dispatch requests.
     33 const page_handler_t page_handlers[] = {
     34     { .handler = &handler_index_html, .url = "/" }
     35   , { .handler = &handler_config_html, .url = "/config.html" }
     36 };
     37 const uint8_t number_of_page_handlers = (sizeof(page_handlers) /
     38                                          sizeof(page_handlers[0]));
     39 
     40 /* Check internal voltage level. */
     41 extern int rom_phy_get_vdd33();
     42 #endif