diff Output/pjrcUSB/output_com.h @ 420:23a1868b4ac2

Adding dynamic USB power support - Each scan module now has a current change callback which passes the available current as a parameter - No longer attempts to use the max 500 mA immediately, starts with 100 mA then goes to 500 mA after enumeration - If enumeration fails due to bMaxPower of 500 mA, then attempt again at 100 mA (might also be possible to go even lower to 20 mA in certain cases) - Now working with the Apple Ipad (no over-power messages) - Fixed Wake-up behaviour on Apple Ipad (and likely other iOS devices) - More effecient set_feature/clear_feature handling (device handler) - Initial power handling via Interconnect (still needs work to get it more dynamic)
author Jacob Alexander <haata@kiibohd.com>
date Sun, 21 Feb 2016 19:56:52 -0800
parents 39e338a6733d
children 970dab727f47
line wrap: on
line diff
--- a/Output/pjrcUSB/output_com.h	Sun Feb 21 14:19:52 2016 -0800
+++ b/Output/pjrcUSB/output_com.h	Sun Feb 21 19:56:52 2016 -0800
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2015 by Jacob Alexander
+/* Copyright (C) 2013-2016 by Jacob Alexander
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
@@ -82,6 +82,8 @@
 
 extern          uint8_t  Output_DebugMode; // 0 - Debug disabled, 1 - Debug enabled
 
+extern          uint16_t Output_ExtCurrent_Available; // mA - Set by outside module if not using USB (i.e. Interconnect)
+
 
 
 // ----- Functions -----
@@ -97,6 +99,12 @@
 // Relies on USB serial module
 unsigned int Output_availablechar();
 
+// Returns the total mA available (total, if used in a chain, each device will have to use a slice of it)
+unsigned int Output_current_available();
+
+void Output_update_external_current( unsigned int current );
+void Output_update_usb_current( unsigned int current );
+
 int Output_getchar();
 int Output_putchar( char c );
 int Output_putstr( char* str );